Commit cc470d55 authored by Zheng Yongjun's avatar Zheng Yongjun Committed by Mark Brown

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

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: deba2580 ("spi: Add driver for IMG SPFI controller")
Signed-off-by: default avatarZheng Yongjun <zhengyongjun3@huawei.com>
Link: https://lore.kernel.org/r/20220422062641.10486-1-zhengyongjun3@huawei.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent c2b5a40c
...@@ -731,7 +731,7 @@ static int img_spfi_resume(struct device *dev) ...@@ -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;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment