aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorGuenter Roeck <guenter.roeck@ericsson.com>2010-07-10 03:42:47 -0400
committerJean Delvare <khali@linux-fr.org>2010-07-10 03:42:47 -0400
commit102b59c6d6d30fb6560177fd1ae8a34c4c163897 (patch)
tree7e39292a3c448479df96f1ba6a0941de32e65d76 /drivers
parent827900c55665dc8e20b05bb18d3f6e078eaa6183 (diff)
i2c/mips: Fix error return codes from Sibyte i2c bus driver
Sibyte i2c bus driver returns non-descriptive error values. Update to return error values as defined in Documentation/i2c/fault-codes. Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com> Signed-off-by: Jean Delvare <khali@linux-fr.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/i2c/busses/i2c-sibyte.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/i2c/busses/i2c-sibyte.c b/drivers/i2c/busses/i2c-sibyte.c
index 3d76a188e42f..0fe505d7abe9 100644
--- a/drivers/i2c/busses/i2c-sibyte.c
+++ b/drivers/i2c/busses/i2c-sibyte.c
@@ -94,7 +94,7 @@ static int smbus_xfer(struct i2c_adapter *i2c_adap, u16 addr,
94 } 94 }
95 break; 95 break;
96 default: 96 default:
97 return -1; /* XXXKW better error code? */ 97 return -EOPNOTSUPP;
98 } 98 }
99 99
100 while (csr_in32(SMB_CSR(adap, R_SMB_STATUS)) & M_SMB_BUSY) 100 while (csr_in32(SMB_CSR(adap, R_SMB_STATUS)) & M_SMB_BUSY)
@@ -104,7 +104,7 @@ static int smbus_xfer(struct i2c_adapter *i2c_adap, u16 addr,
104 if (error & M_SMB_ERROR) { 104 if (error & M_SMB_ERROR) {
105 /* Clear error bit by writing a 1 */ 105 /* Clear error bit by writing a 1 */
106 csr_out32(M_SMB_ERROR, SMB_CSR(adap, R_SMB_STATUS)); 106 csr_out32(M_SMB_ERROR, SMB_CSR(adap, R_SMB_STATUS));
107 return -1; /* XXXKW better error code? */ 107 return (error & M_SMB_ERROR_TYPE) ? -EIO : -ENXIO;
108 } 108 }
109 109
110 if (data_bytes == 1) 110 if (data_bytes == 1)