Skip to content

Commit c170a5a

Browse files
Dan Carpenterbroonie
authored andcommitted
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: db96bf9 ("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>
1 parent b59a7ca commit c170a5a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/spi/spi-stm32.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2064,7 +2064,7 @@ static int stm32_spi_resume(struct device *dev)
20642064
}
20652065

20662066
ret = pm_runtime_get_sync(dev);
2067-
if (ret) {
2067+
if (ret < 0) {
20682068
dev_err(dev, "Unable to power device:%d\n", ret);
20692069
return ret;
20702070
}

0 commit comments

Comments
 (0)