Commit 4403988a authored by Jean Delvare's avatar Jean Delvare Committed by Jean Delvare

i2c-algo-pca: Return standard fault codes

Adjust i2c-algo-pca to return fault codes compliant with
Documentation/i2c/fault-codes, rather than the undocumented and
vague -EREMOTEIO.
Signed-off-by: default avatarJean Delvare <khali@linux-fr.org>
Cc: Wolfram Sang <w.sang@pengutronix.de>
parent abc01b27
...@@ -196,7 +196,7 @@ static int pca_xfer(struct i2c_adapter *i2c_adap, ...@@ -196,7 +196,7 @@ static int pca_xfer(struct i2c_adapter *i2c_adap,
} else { } else {
dev_dbg(&i2c_adap->dev, "bus is not idle. status is " dev_dbg(&i2c_adap->dev, "bus is not idle. status is "
"%#04x\n", state); "%#04x\n", state);
return -EAGAIN; return -EBUSY;
} }
} }
...@@ -224,7 +224,7 @@ static int pca_xfer(struct i2c_adapter *i2c_adap, ...@@ -224,7 +224,7 @@ static int pca_xfer(struct i2c_adapter *i2c_adap,
} }
curmsg = 0; curmsg = 0;
ret = -EREMOTEIO; ret = -EIO;
while (curmsg < num) { while (curmsg < num) {
state = pca_status(adap); state = pca_status(adap);
...@@ -259,6 +259,7 @@ static int pca_xfer(struct i2c_adapter *i2c_adap, ...@@ -259,6 +259,7 @@ static int pca_xfer(struct i2c_adapter *i2c_adap,
case 0x20: /* SLA+W has been transmitted; NOT ACK has been received */ case 0x20: /* SLA+W has been transmitted; NOT ACK has been received */
DEB2("NOT ACK received after SLA+W\n"); DEB2("NOT ACK received after SLA+W\n");
pca_stop(adap); pca_stop(adap);
ret = -ENXIO;
goto out; goto out;
case 0x40: /* SLA+R has been transmitted; ACK has been received */ case 0x40: /* SLA+R has been transmitted; ACK has been received */
...@@ -283,6 +284,7 @@ static int pca_xfer(struct i2c_adapter *i2c_adap, ...@@ -283,6 +284,7 @@ static int pca_xfer(struct i2c_adapter *i2c_adap,
case 0x48: /* SLA+R has been transmitted; NOT ACK has been received */ case 0x48: /* SLA+R has been transmitted; NOT ACK has been received */
DEB2("NOT ACK received after SLA+R\n"); DEB2("NOT ACK received after SLA+R\n");
pca_stop(adap); pca_stop(adap);
ret = -ENXIO;
goto out; goto out;
case 0x30: /* Data byte in I2CDAT has been transmitted; NOT ACK has been received */ case 0x30: /* Data byte in I2CDAT has been transmitted; NOT ACK has been received */
......
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