Commit c2a3b3cc authored by Dmitry Bazhenov's avatar Dmitry Bazhenov Committed by Wolfram Sang

i2c: xlp9xx: return ENXIO on slave address NACK

Fix the driver violation of the common practice to return
ENXIO error on a slave address NACK.
Signed-off-by: default avatarDmitry Bazhenov <dmitry.bazhenov@auriga.com>
Signed-off-by: default avatarGeorge Cherian <george.cherian@cavium.com>
Tested-by: default avatardann frazier <dann.frazier@canonical.com>
Signed-off-by: default avatarWolfram Sang <wsa@the-dreams.de>
parent d0adf769
......@@ -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) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment