mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] i2c: xiic: print error code when xiic_start_xfer fails
@ 2024-05-06 15:45 marc.ferland
  2024-05-08 12:51 ` Andi Shyti
  0 siblings, 1 reply; 3+ messages in thread
From: marc.ferland @ 2024-05-06 15:45 UTC (permalink / raw)
  To: michal.simek
  Cc: andi.shyti, linux-arm-kernel, linux-i2c, linux-kernel, Marc Ferland

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-05-08 13:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-06 15:45 [PATCH] i2c: xiic: print error code when xiic_start_xfer fails marc.ferland
2024-05-08 12:51 ` Andi Shyti
2024-05-08 13:47   ` Marc Ferland

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®