diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-08-11 16:01:54 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-08-11 16:01:54 -0400 |
commit | f2556896597c43cb48f04b1c16214938a6ccce9a (patch) | |
tree | 9e068d92ecf2c41b7b0f36a9688c56fd5fe39709 /drivers/i2c/i2c-core.c | |
parent | 7c13e6a3d15a4ebcc3f40df5f4d19665479f8ca3 (diff) | |
parent | 10fec20ef5eec1c91913baec1225400f0d02df40 (diff) |
Merge branch 'linus' into x86/defconfig
Diffstat (limited to 'drivers/i2c/i2c-core.c')
-rw-r--r-- | drivers/i2c/i2c-core.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c index 7bf38c418086..550853f79ae8 100644 --- a/drivers/i2c/i2c-core.c +++ b/drivers/i2c/i2c-core.c | |||
@@ -813,7 +813,12 @@ static int i2c_check_addr(struct i2c_adapter *adapter, int addr) | |||
813 | int i2c_attach_client(struct i2c_client *client) | 813 | int i2c_attach_client(struct i2c_client *client) |
814 | { | 814 | { |
815 | struct i2c_adapter *adapter = client->adapter; | 815 | struct i2c_adapter *adapter = client->adapter; |
816 | int res = 0; | 816 | int res; |
817 | |||
818 | /* Check for address business */ | ||
819 | res = i2c_check_addr(adapter, client->addr); | ||
820 | if (res) | ||
821 | return res; | ||
817 | 822 | ||
818 | client->dev.parent = &client->adapter->dev; | 823 | client->dev.parent = &client->adapter->dev; |
819 | client->dev.bus = &i2c_bus_type; | 824 | client->dev.bus = &i2c_bus_type; |
@@ -1451,9 +1456,11 @@ i2c_new_probed_device(struct i2c_adapter *adap, | |||
1451 | if ((addr_list[i] & ~0x07) == 0x30 | 1456 | if ((addr_list[i] & ~0x07) == 0x30 |
1452 | || (addr_list[i] & ~0x0f) == 0x50 | 1457 | || (addr_list[i] & ~0x0f) == 0x50 |
1453 | || !i2c_check_functionality(adap, I2C_FUNC_SMBUS_QUICK)) { | 1458 | || !i2c_check_functionality(adap, I2C_FUNC_SMBUS_QUICK)) { |
1459 | union i2c_smbus_data data; | ||
1460 | |||
1454 | if (i2c_smbus_xfer(adap, addr_list[i], 0, | 1461 | if (i2c_smbus_xfer(adap, addr_list[i], 0, |
1455 | I2C_SMBUS_READ, 0, | 1462 | I2C_SMBUS_READ, 0, |
1456 | I2C_SMBUS_BYTE, NULL) >= 0) | 1463 | I2C_SMBUS_BYTE, &data) >= 0) |
1457 | break; | 1464 | break; |
1458 | } else { | 1465 | } else { |
1459 | if (i2c_smbus_xfer(adap, addr_list[i], 0, | 1466 | if (i2c_smbus_xfer(adap, addr_list[i], 0, |