public inbox for linux-iio@vger.kernel.org
 help / color / mirror / Atom feed
From: Denis Benato <benato.denis96@gmail.com>
To: Dan Carpenter <dan.carpenter@linaro.org>
Cc: Jagath Jog J <jagathjog1996@gmail.com>,
	Jonathan Cameron <jic23@kernel.org>,
	Lars-Peter Clausen <lars@metafoo.de>,
	linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] iio: bmi323: fix reversed if statement in bmi323_core_runtime_resume()
Date: Sat, 14 Sep 2024 14:10:46 +0200	[thread overview]
Message-ID: <84c6a027-284c-4985-8125-d46a04c4ea5f@gmail.com> (raw)
In-Reply-To: <273b8f96-0d32-4913-bc6b-e91b391e7d7c@stanley.mountain>

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@linaro.org>
> ---
>  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

  reply	other threads:[~2024-09-14 12:10 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-11  7:54 [PATCH 0/2] iio: bmi323: Fix some bugs in suspend resume Dan Carpenter
2024-09-11  7:54 ` [PATCH 1/2] iio: bmi323: fix copy and paste " Dan Carpenter
2024-09-11  7:54 ` [PATCH 2/2] iio: bmi323: fix reversed if statement in bmi323_core_runtime_resume() Dan Carpenter
2024-09-14 12:10   ` Denis Benato [this message]
2024-09-14 14:21 ` [PATCH 0/2] iio: bmi323: Fix some bugs in suspend resume Jonathan Cameron

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=84c6a027-284c-4985-8125-d46a04c4ea5f@gmail.com \
    --to=benato.denis96@gmail.com \
    --cc=dan.carpenter@linaro.org \
    --cc=jagathjog1996@gmail.com \
    --cc=jic23@kernel.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox