spi: img-spfi: Fix pm_runtime_get_sync() error checking

[ Upstream commit cc470d5534 ]

If the device is already in a runtime PM enabled state
pm_runtime_get_sync() will return 1, so a test for negative
value should be used to check for errors.

Fixes: deba25800a ("spi: Add driver for IMG SPFI controller")
Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
Link: https://lore.kernel.org/r/20220422062641.10486-1-zhengyongjun3@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
Zheng Yongjun 2022-04-22 06:26:41 +00:00 коммит произвёл Greg Kroah-Hartman
Родитель dc4d1f3b53
Коммит 7ba2bb87e9
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -731,7 +731,7 @@ static int img_spfi_resume(struct device *dev)
int ret; int ret;
ret = pm_runtime_get_sync(dev); ret = pm_runtime_get_sync(dev);
if (ret) { if (ret < 0) {
pm_runtime_put_noidle(dev); pm_runtime_put_noidle(dev);
return ret; return ret;
} }