aboutsummaryrefslogtreecommitdiff
path: root/drivers/i2c/busses/i2c-xlp9xx.c
diff options
context:
space:
mode:
authorDmitry Bazhenov <dmitry.bazhenov@auriga.com>2018-01-18 05:39:21 +0000
committerWolfram Sang <wsa@the-dreams.de>2018-02-26 21:14:09 +0100
commitc2a3b3cce8df1cafeda2ab03563d7e703c51a4ac (patch)
tree9af98588349453ffb1ec69c4bbaf59c1559f7adb /drivers/i2c/busses/i2c-xlp9xx.c
parentd0adf769df210248f60d33e62b1d4d14df271c02 (diff)
downloadlinux-stericsson-c2a3b3cce8df1cafeda2ab03563d7e703c51a4ac.tar.gz
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: Dmitry Bazhenov <dmitry.bazhenov@auriga.com> Signed-off-by: George Cherian <george.cherian@cavium.com> Tested-by: dann frazier <dann.frazier@canonical.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Diffstat (limited to 'drivers/i2c/busses/i2c-xlp9xx.c')
-rw-r--r--drivers/i2c/busses/i2c-xlp9xx.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/i2c/busses/i2c-xlp9xx.c b/drivers/i2c/busses/i2c-xlp9xx.c
index b970bf8f38e5..6d78cdc5cf91 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) {