All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/4] i2c: xlp9xx: return ENXIO on slave address NACK
@ 2018-01-18  5:39 George Cherian
  2018-01-18  5:39 ` [PATCH 2/4] i2c: xlp9xx: Handle transactions with I2C_M_RECV_LEN properly George Cherian
                   ` (4 more replies)
  0 siblings, 5 replies; 16+ messages in thread
From: George Cherian @ 2018-01-18  5:39 UTC (permalink / raw)
  To: linux-kernel, linux-i2c; +Cc: wsa, Dmitry Bazhenov, George Cherian

From: Dmitry Bazhenov <dmitry.bazhenov@auriga.com>

Fix the driver violation of the common practice to return
ENXIO error on a slave address NACK.

Signed-off-by: Dmitry Bazhenov <dmitry.bazhenov@auriga.com>
Signed-off-by: George Cherian <george.cherian@cavium.com>
---
 drivers/i2c/busses/i2c-xlp9xx.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/i2c/busses/i2c-xlp9xx.c b/drivers/i2c/busses/i2c-xlp9xx.c
index b970bf8..6d78cdc 100644
--- a/drivers/i2c/busses/i2c-xlp9xx.c
+++ b/drivers/i2c/busses/i2c-xlp9xx.c
@@ -324,7 +324,8 @@ static int xlp9xx_i2c_xfer_msg(struct xlp9xx_i2c_dev *priv, struct i2c_msg *msg,
 		dev_dbg(priv->dev, "transfer error %x!\n", priv->msg_err);
 		if (priv->msg_err & XLP9XX_I2C_INTEN_BUSERR)
 			xlp9xx_i2c_init(priv);
-		return -EIO;
+		return (priv->msg_err & XLP9XX_I2C_INTEN_NACKADDR) ?
+			-ENXIO : -EIO;
 	}
 
 	if (timeleft == 0) {
-- 
2.1.4

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

end of thread, other threads:[~2018-02-27  9:33 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-18  5:39 [PATCH 1/4] i2c: xlp9xx: return ENXIO on slave address NACK George Cherian
2018-01-18  5:39 ` [PATCH 2/4] i2c: xlp9xx: Handle transactions with I2C_M_RECV_LEN properly George Cherian
2018-02-26 20:20   ` Wolfram Sang
2018-01-18  5:39 ` [PATCH 3/4] i2c: xlp9xx: report SMBus block read functionality George Cherian
2018-02-26 20:21   ` Wolfram Sang
2018-01-18  5:39 ` [PATCH 4/4] i2c: xlp9xx: Check for Bus state after every transfer George Cherian
2018-02-26 20:22   ` Wolfram Sang
2018-02-27  5:00     ` George Cherian
2018-02-27  5:11       ` George Cherian
2018-02-27  9:05         ` Wolfram Sang
2018-02-27  9:32           ` George Cherian
2018-02-27  9:04       ` Wolfram Sang
2018-02-27  9:32         ` George Cherian
2018-01-30 14:28 ` [PATCH 1/4] i2c: xlp9xx: return ENXIO on slave address NACK George Cherian
2018-02-22 18:02   ` dann frazier
2018-02-26 20:20 ` Wolfram Sang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.