diff options
author | Jean Delvare <khali@linux-fr.org> | 2011-10-30 08:47:25 -0400 |
---|---|---|
committer | Jean Delvare <khali@endymion.delvare> | 2011-10-30 08:47:25 -0400 |
commit | 4403988afc0a92b8faf59b46f51d25fafaf0e63d (patch) | |
tree | 0d3ddd323a5dcbb35e84014b3f33a4380c577dc2 /drivers | |
parent | abc01b2718ee1d26e83c4c62c4b79806b3240ac7 (diff) |
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: Jean Delvare <khali@linux-fr.org>
Cc: Wolfram Sang <w.sang@pengutronix.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/i2c/algos/i2c-algo-pca.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/i2c/algos/i2c-algo-pca.c b/drivers/i2c/algos/i2c-algo-pca.c index 4ca9cf9cde73..beb9ffe2564b 100644 --- a/drivers/i2c/algos/i2c-algo-pca.c +++ b/drivers/i2c/algos/i2c-algo-pca.c | |||
@@ -196,7 +196,7 @@ static int pca_xfer(struct i2c_adapter *i2c_adap, | |||
196 | } else { | 196 | } else { |
197 | dev_dbg(&i2c_adap->dev, "bus is not idle. status is " | 197 | dev_dbg(&i2c_adap->dev, "bus is not idle. status is " |
198 | "%#04x\n", state); | 198 | "%#04x\n", state); |
199 | return -EAGAIN; | 199 | return -EBUSY; |
200 | } | 200 | } |
201 | } | 201 | } |
202 | 202 | ||
@@ -224,7 +224,7 @@ static int pca_xfer(struct i2c_adapter *i2c_adap, | |||
224 | } | 224 | } |
225 | 225 | ||
226 | curmsg = 0; | 226 | curmsg = 0; |
227 | ret = -EREMOTEIO; | 227 | ret = -EIO; |
228 | while (curmsg < num) { | 228 | while (curmsg < num) { |
229 | state = pca_status(adap); | 229 | state = pca_status(adap); |
230 | 230 | ||
@@ -259,6 +259,7 @@ static int pca_xfer(struct i2c_adapter *i2c_adap, | |||
259 | case 0x20: /* SLA+W has been transmitted; NOT ACK has been received */ | 259 | case 0x20: /* SLA+W has been transmitted; NOT ACK has been received */ |
260 | DEB2("NOT ACK received after SLA+W\n"); | 260 | DEB2("NOT ACK received after SLA+W\n"); |
261 | pca_stop(adap); | 261 | pca_stop(adap); |
262 | ret = -ENXIO; | ||
262 | goto out; | 263 | goto out; |
263 | 264 | ||
264 | case 0x40: /* SLA+R has been transmitted; ACK has been received */ | 265 | 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 | case 0x48: /* SLA+R has been transmitted; NOT ACK has been received */ | 284 | case 0x48: /* SLA+R has been transmitted; NOT ACK has been received */ |
284 | DEB2("NOT ACK received after SLA+R\n"); | 285 | DEB2("NOT ACK received after SLA+R\n"); |
285 | pca_stop(adap); | 286 | pca_stop(adap); |
287 | ret = -ENXIO; | ||
286 | goto out; | 288 | goto out; |
287 | 289 | ||
288 | case 0x30: /* Data byte in I2CDAT has been transmitted; NOT ACK has been received */ | 290 | case 0x30: /* Data byte in I2CDAT has been transmitted; NOT ACK has been received */ |