diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-07-11 16:32:55 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-07-11 16:32:55 -0400 |
commit | 80519bc77b52729ca49b278b67d58715e38b85e9 (patch) | |
tree | 9c6dca32abb277f23a8eb99bfc39997cef42c6c7 | |
parent | ecd4b48a163b55d7eb4132617100b90d0d2768ec (diff) | |
parent | 102b59c6d6d30fb6560177fd1ae8a34c4c163897 (diff) |
Merge branch 'i2c-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging
* 'i2c-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging:
i2c/mips: Fix error return codes from Sibyte i2c bus driver
i2c: Fix probability check
-rw-r--r-- | drivers/i2c/busses/i2c-sibyte.c | 4 | ||||
-rw-r--r-- | drivers/i2c/i2c-core.c | 7 |
2 files changed, 5 insertions, 6 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) |
diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c index 1cca2631e5b3..0815e10da7c6 100644 --- a/drivers/i2c/i2c-core.c +++ b/drivers/i2c/i2c-core.c | |||
@@ -1428,13 +1428,12 @@ static int i2c_detect(struct i2c_adapter *adapter, struct i2c_driver *driver) | |||
1428 | if (!(adapter->class & driver->class)) | 1428 | if (!(adapter->class & driver->class)) |
1429 | goto exit_free; | 1429 | goto exit_free; |
1430 | 1430 | ||
1431 | /* Stop here if we can't use SMBUS_QUICK */ | 1431 | /* Stop here if the bus doesn't support probing */ |
1432 | if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_QUICK)) { | 1432 | if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_READ_BYTE)) { |
1433 | if (address_list[0] == I2C_CLIENT_END) | 1433 | if (address_list[0] == I2C_CLIENT_END) |
1434 | goto exit_free; | 1434 | goto exit_free; |
1435 | 1435 | ||
1436 | dev_warn(&adapter->dev, "SMBus Quick command not supported, " | 1436 | dev_warn(&adapter->dev, "Probing not supported\n"); |
1437 | "can't probe for chips\n"); | ||
1438 | err = -EOPNOTSUPP; | 1437 | err = -EOPNOTSUPP; |
1439 | goto exit_free; | 1438 | goto exit_free; |
1440 | } | 1439 | } |