From: marc.ferland@gmail.com
To: michal.simek@amd.com
Cc: andi.shyti@kernel.org, linux-arm-kernel@lists.infradead.org,
linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org,
Marc Ferland <marc.ferland@sonatest.com>
Subject: [PATCH] i2c: xiic: print error code when xiic_start_xfer fails
Date: Mon, 6 May 2024 11:45:20 -0400 [thread overview]
Message-ID: <20240506154520.3886867-1-marc.ferland@sonatest.com> (raw)
From: Marc Ferland <marc.ferland@sonatest.com>
xiic_start_xfer can fail for different reasons:
- EBUSY: bus is busy or i2c messages still in tx_msg or rx_msg
- ETIMEDOUT: timed-out trying to clear the RX fifo
- EINVAL: wrong clock settings
Printing the error code helps identifying the root cause.
Signed-off-by: Marc Ferland <marc.ferland@sonatest.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 71391b590ada..73729f0180a1 100644
--- a/drivers/i2c/busses/i2c-xiic.c
+++ b/drivers/i2c/busses/i2c-xiic.c
@@ -1165,7 +1165,7 @@ static int xiic_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num)
err = xiic_start_xfer(i2c, msgs, num);
if (err < 0) {
- dev_err(adap->dev.parent, "Error xiic_start_xfer\n");
+ dev_err(adap->dev.parent, "Error xiic_start_xfer: %d\n", err);
goto out;
}
--
2.34.1
next reply other threads:[~2024-05-06 15:45 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-06 15:45 marc.ferland [this message]
2024-05-08 12:51 ` [PATCH] i2c: xiic: print error code when xiic_start_xfer fails Andi Shyti
2024-05-08 13:47 ` Marc Ferland
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=20240506154520.3886867-1-marc.ferland@sonatest.com \
--to=marc.ferland@gmail.com \
--cc=andi.shyti@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=marc.ferland@sonatest.com \
--cc=michal.simek@amd.com \
/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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).