[Linux-stm32] [PATCH] spi: stm32: fix pm_runtime_get_sync() error checking
Alain Volmat
alain.volmat at st.com
Wed Sep 9 10:28:23 UTC 2020
Hi Dan,
Thanks for the patch.
On Wed, Sep 09, 2020 at 12:43:04PM +0300, Dan Carpenter wrote:
> 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 at oracle.com>
Reviewed-by: Alain Volmat <alain.volmat at st.com>
> ---
> drivers/spi/spi-stm32.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/spi/spi-stm32.c b/drivers/spi/spi-stm32.c
> index d4b33b358a31..19064df42d25 100644
> --- a/drivers/spi/spi-stm32.c
> +++ b/drivers/spi/spi-stm32.c
> @@ -2060,7 +2060,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;
> }
> --
> 2.28.0
>
More information about the Linux-stm32
mailing list