]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
Merge branch 'i2c-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvar...
authorLinus Torvalds <torvalds@linux-foundation.org>
Sun, 11 Jul 2010 20:32:55 +0000 (13:32 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sun, 11 Jul 2010 20:32:55 +0000 (13:32 -0700)
* '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

drivers/i2c/busses/i2c-sibyte.c
drivers/i2c/i2c-core.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)
index 1cca2631e5b3bc8331062617a68968006a9fd06e..0815e10da7c6da3b5ed4974cdb505fc848c43d87 100644 (file)
@@ -1428,13 +1428,12 @@ static int i2c_detect(struct i2c_adapter *adapter, struct i2c_driver *driver)
        if (!(adapter->class & driver->class))
                goto exit_free;
 
-       /* Stop here if we can't use SMBUS_QUICK */
-       if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_QUICK)) {
+       /* Stop here if the bus doesn't support probing */
+       if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_READ_BYTE)) {
                if (address_list[0] == I2C_CLIENT_END)
                        goto exit_free;
 
-               dev_warn(&adapter->dev, "SMBus Quick command not supported, "
-                        "can't probe for chips\n");
+               dev_warn(&adapter->dev, "Probing not supported\n");
                err = -EOPNOTSUPP;
                goto exit_free;
        }