public inbox for linux-i2c@vger.kernel.org
 help / color / mirror / Atom feed
From: Michal Simek <michal.simek@amd.com>
To: Daniel Scally <dan.scally@ideasonboard.com>,
	Andi Shyti <andi.shyti@kernel.org>, Wolfram Sang <wsa@kernel.org>,
	Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-i2c@vger.kernel.org>
Cc: Raviteja Narayanam <raviteja.narayanam@xilinx.com>
Subject: Re: [PATCH] i2c: xiic: Correct return value check for xiic_reinit()
Date: Thu, 21 Sep 2023 14:13:18 +0200	[thread overview]
Message-ID: <9d7c23aa-b87e-45ea-843b-576c5552a6c6@amd.com> (raw)
In-Reply-To: <20230920134109.2232769-1-dan.scally@ideasonboard.com>



On 9/20/23 15:41, Daniel Scally wrote:
> The error paths for xiic_reinit() return negative values on failure
> and 0 on success - this error message therefore is triggered on
> _success_ rather than failure. Correct the condition so it's only
> shown on failure as intended.
> 
> Fixes: 8fa9c9388053 ("i2c: xiic: return value of xiic_reinit")
> Signed-off-by: Daniel Scally <dan.scally@ideasonboard.com>
> ---
>   drivers/i2c/busses/i2c-xiic.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/i2c/busses/i2c-xiic.c b/drivers/i2c/busses/i2c-xiic.c
> index b3bb97762c85..71391b590ada 100644
> --- a/drivers/i2c/busses/i2c-xiic.c
> +++ b/drivers/i2c/busses/i2c-xiic.c
> @@ -710,7 +710,7 @@ static irqreturn_t xiic_process(int irq, void *dev_id)
>   		 * reset the IP instead of just flush fifos
>   		 */
>   		ret = xiic_reinit(i2c);
> -		if (!ret)
> +		if (ret < 0)
>   			dev_dbg(i2c->adap.dev.parent, "reinit failed\n");
>   
>   		if (i2c->rx_msg) {

It would be interesting to know how origin patch was tested.
Anyway
Acked-by: Michal Simek <michal.simek@amd.com>

Thanks,
Michal

  reply	other threads:[~2023-09-21 17:09 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-20 13:41 [PATCH] i2c: xiic: Correct return value check for xiic_reinit() Daniel Scally
2023-09-21 12:13 ` Michal Simek [this message]
2023-09-21 21:30 ` Andi Shyti
2023-09-22 10:07 ` Wolfram Sang

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=9d7c23aa-b87e-45ea-843b-576c5552a6c6@amd.com \
    --to=michal.simek@amd.com \
    --cc=andi.shyti@kernel.org \
    --cc=dan.scally@ideasonboard.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=raviteja.narayanam@xilinx.com \
    --cc=shubhrajyoti.datta@xilinx.com \
    --cc=wsa@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