Commit c170a5a3 authored by Dan Carpenter's avatar Dan Carpenter Committed by Mark Brown

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: db96bf97 ("spi: stm32: fixes suspend/resume management")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: default avatarAlain Volmat <alain.volmat@st.com>
Link: https://lore.kernel.org/r/20200909094304.GA420136@mwandaSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent b59a7ca1
...@@ -2064,7 +2064,7 @@ static int stm32_spi_resume(struct device *dev) ...@@ -2064,7 +2064,7 @@ static int stm32_spi_resume(struct device *dev)
} }
ret = pm_runtime_get_sync(dev); ret = pm_runtime_get_sync(dev);
if (ret) { if (ret < 0) {
dev_err(dev, "Unable to power device:%d\n", ret); dev_err(dev, "Unable to power device:%d\n", ret);
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