Skip to content

Commit

Permalink
spi: stm32: fix pm_runtime_get_sync() error checking
Browse files Browse the repository at this point in the history
[ Upstream commit c170a5a ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Dan Carpenter authored and gregkh committed Sep 17, 2020
1 parent e3364a8 commit bc1d374
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/spi/spi-stm32.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit bc1d374

Please sign in to comment.