summaryrefslogtreecommitdiffstats
path: root/drivers/spi
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2020-09-09 12:43:04 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-09-17 13:47:44 +0200
commit45ffad151baed2e946658da840fd043ff2ef14eb (patch)
treef4de162e67e445033416cf29f1416cea1283155c /drivers/spi
parent9ed3ab0c62d491b507bbd55e3b4c5911bc160e88 (diff)
downloadlinux-stable-45ffad151baed2e946658da840fd043ff2ef14eb.tar.gz
linux-stable-45ffad151baed2e946658da840fd043ff2ef14eb.tar.bz2
linux-stable-45ffad151baed2e946658da840fd043ff2ef14eb.zip
spi: stm32: fix pm_runtime_get_sync() error checking
[ Upstream commit c170a5a3b6944ad8e76547c4a1d9fe81c8f23ac8 ] The pm_runtime_get_sync() can return either 0 or 1 on success but this code treats 1 as a failure. Fixes: db96bf976a4f ("spi: stm32: fixes suspend/resume management") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Alain Volmat <alain.volmat@st.com> Link: https://lore.kernel.org/r/20200909094304.GA420136@mwanda Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/spi')
-rw-r--r--drivers/spi/spi-stm32.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/spi/spi-stm32.c b/drivers/spi/spi-stm32.c
index 09b418ff99b1..9d8ceb63f7db 100644
--- a/drivers/spi/spi-stm32.c
+++ b/drivers/spi/spi-stm32.c
@@ -2054,7 +2054,7 @@ static int stm32_spi_resume(struct device *dev)
}
ret = pm_runtime_get_sync(dev);
- if (ret) {
+ if (ret < 0) {
dev_err(dev, "Unable to power device:%d\n", ret);
return ret;
}