From: Daniel Scally <dan.scally@ideasonboard.com>
To: Michal Simek <michal.simek@amd.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>,
Daniel Scally <dan.scally@ideasonboard.com>
Subject: [PATCH] i2c: xiic: Correct return value check for xiic_reinit()
Date: Wed, 20 Sep 2023 14:41:09 +0100 [thread overview]
Message-ID: <20230920134109.2232769-1-dan.scally@ideasonboard.com> (raw)
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) {
--
2.34.1
next reply other threads:[~2023-09-20 13:41 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-20 13:41 Daniel Scally [this message]
2023-09-21 12:13 ` [PATCH] i2c: xiic: Correct return value check for xiic_reinit() Michal Simek
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=20230920134109.2232769-1-dan.scally@ideasonboard.com \
--to=dan.scally@ideasonboard.com \
--cc=andi.shyti@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-i2c@vger.kernel.org \
--cc=michal.simek@amd.com \
--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