Re: [PATCH 2/2] iio: bmi323: fix reversed if statement in bmi323_core_runtime_resume()

From: Denis Benato
Date: Sat Sep 14 2024 - 08:11:02 EST


On 11/09/24 09:54, Dan Carpenter wrote:
> This reversed if statement means that the function just returns success
> without writing to the registers.
>
> Fixes: 16531118ba63 ("iio: bmi323: peripheral in lowest power state on suspend")
> Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
> ---
> drivers/iio/imu/bmi323/bmi323_core.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/iio/imu/bmi323/bmi323_core.c b/drivers/iio/imu/bmi323/bmi323_core.c
> index d415b6542089..a56259c6434e 100644
> --- a/drivers/iio/imu/bmi323/bmi323_core.c
> +++ b/drivers/iio/imu/bmi323/bmi323_core.c
> @@ -2232,7 +2232,7 @@ static int bmi323_core_runtime_resume(struct device *dev)
> * after being reset in the lower power state by runtime-pm.
> */
> ret = bmi323_init(data);
> - if (!ret)
> + if (ret)
> return ret;
>
> /* Register must be cleared before changing an active config */
Hi,

Thanks for spotting this. May I ask to add an error message in that if case that will also print out the ret value?

Thank you very much!

Best regards,
Denis Benato