]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
i2c/mips: Fix error return codes from Sibyte i2c bus driver
authorGuenter Roeck <guenter.roeck@ericsson.com>
Sat, 10 Jul 2010 07:42:47 +0000 (09:42 +0200)
committerJean Delvare <khali@linux-fr.org>
Sat, 10 Jul 2010 07:42:47 +0000 (09:42 +0200)
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>
drivers/i2c/busses/i2c-sibyte.c

index 3d76a188e42fd5dfe1605a00399e787cdaf961a4..0fe505d7abe9b65e93882862e98ba586b2e73407 100644 (file)
@@ -94,7 +94,7 @@ static int smbus_xfer(struct i2c_adapter *i2c_adap, u16 addr,
                }
                break;
        default:
-               return -1;      /* XXXKW better error code? */
+               return -EOPNOTSUPP;
        }
 
        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,
        if (error & M_SMB_ERROR) {
                /* Clear error bit by writing a 1 */
                csr_out32(M_SMB_ERROR, SMB_CSR(adap, R_SMB_STATUS));
-               return -1;      /* XXXKW better error code? */
+               return (error & M_SMB_ERROR_TYPE) ? -EIO : -ENXIO;
        }
 
        if (data_bytes == 1)