Merge branch 'x86-mm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
[deliverable/linux.git] / drivers / i2c / i2c-core.c
index a6ad32bc0a96d633629f5a2a4cd85cdf3420c57d..26488aa893d5e5dc62ac2d01c332dd2d4ca9d2a1 100644 (file)
@@ -2122,7 +2122,7 @@ s32 i2c_smbus_xfer(struct i2c_adapter *adapter, u16 addr, unsigned short flags,
        int try;
        s32 res;
 
-       flags &= I2C_M_TEN | I2C_CLIENT_PEC;
+       flags &= I2C_M_TEN | I2C_CLIENT_PEC | I2C_CLIENT_SCCB;
 
        if (adapter->algo->smbus_xfer) {
                i2c_lock_adapter(adapter);
@@ -2140,11 +2140,17 @@ s32 i2c_smbus_xfer(struct i2c_adapter *adapter, u16 addr, unsigned short flags,
                                break;
                }
                i2c_unlock_adapter(adapter);
-       } else
-               res = i2c_smbus_xfer_emulated(adapter, addr, flags, read_write,
-                                             command, protocol, data);
 
-       return res;
+               if (res != -EOPNOTSUPP || !adapter->algo->master_xfer)
+                       return res;
+               /*
+                * Fall back to i2c_smbus_xfer_emulated if the adapter doesn't
+                * implement native support for the SMBus operation.
+                */
+       }
+
+       return i2c_smbus_xfer_emulated(adapter, addr, flags, read_write,
+                                      command, protocol, data);
 }
 EXPORT_SYMBOL(i2c_smbus_xfer);
 
This page took 0.024378 seconds and 5 git commands to generate.