diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2020-09-09 12:43:04 +0300 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2020-09-09 17:11:44 +0300 |
commit | c170a5a3b6944ad8e76547c4a1d9fe81c8f23ac8 (patch) | |
tree | cef75f0334a67eb5bb5eae0ddbe79f6a7e6b834f | |
parent | b59a7ca15464c78ea1ba3b280cfc5ac5ece11ade (diff) | |
download | linux-c170a5a3b6944ad8e76547c4a1d9fe81c8f23ac8.tar.xz |
spi: stm32: fix pm_runtime_get_sync() error checking
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>
-rw-r--r-- | drivers/spi/spi-stm32.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/spi/spi-stm32.c b/drivers/spi/spi-stm32.c index a00f6b51ccbf..3056428b09f3 100644 --- a/drivers/spi/spi-stm32.c +++ b/drivers/spi/spi-stm32.c @@ -2064,7 +2064,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; } |