summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZheng Yongjun <zhengyongjun3@huawei.com>2022-04-22 06:26:41 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-06-14 18:11:33 +0200
commite7f0fd6f2566bd174a074f6a0b77f5d8167b78ba (patch)
tree65cd67740643eaafc1d9b65fe03053612ea37dc9
parent735b57a960880dca055fcf739d7f434e380f1425 (diff)
downloadlinux-stable-e7f0fd6f2566bd174a074f6a0b77f5d8167b78ba.tar.gz
linux-stable-e7f0fd6f2566bd174a074f6a0b77f5d8167b78ba.tar.bz2
linux-stable-e7f0fd6f2566bd174a074f6a0b77f5d8167b78ba.zip
spi: img-spfi: Fix pm_runtime_get_sync() error checking
[ Upstream commit cc470d55343056d6b2a5c32e10e0aad06f324078 ] 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: deba25800a12b ("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>
-rw-r--r--drivers/spi/spi-img-spfi.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/spi/spi-img-spfi.c b/drivers/spi/spi-img-spfi.c
index e9ef80983b79..5a6b02843f2b 100644
--- a/drivers/spi/spi-img-spfi.c
+++ b/drivers/spi/spi-img-spfi.c
@@ -771,7 +771,7 @@ static int img_spfi_resume(struct device *dev)
int ret;
ret = pm_runtime_get_sync(dev);
- if (ret) {
+ if (ret < 0) {
pm_runtime_put_noidle(dev);
return ret;
}