diff options
Diffstat (limited to 'drivers/i2c/i2c-sensor-detect.c')
-rw-r--r-- | drivers/i2c/i2c-sensor-detect.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/drivers/i2c/i2c-sensor-detect.c b/drivers/i2c/i2c-sensor-detect.c index 5aede3ca9cb0..c952926c1482 100644 --- a/drivers/i2c/i2c-sensor-detect.c +++ b/drivers/i2c/i2c-sensor-detect.c | |||
@@ -32,7 +32,6 @@ int i2c_detect(struct i2c_adapter *adapter, | |||
32 | int (*found_proc) (struct i2c_adapter *, int, int)) | 32 | int (*found_proc) (struct i2c_adapter *, int, int)) |
33 | { | 33 | { |
34 | int addr, i, found, j, err; | 34 | int addr, i, found, j, err; |
35 | struct i2c_force_data *this_force; | ||
36 | int adapter_id = i2c_adapter_id(adapter); | 35 | int adapter_id = i2c_adapter_id(adapter); |
37 | unsigned short *normal_i2c; | 36 | unsigned short *normal_i2c; |
38 | unsigned short *probe; | 37 | unsigned short *probe; |
@@ -58,13 +57,13 @@ int i2c_detect(struct i2c_adapter *adapter, | |||
58 | /* If it is in one of the force entries, we don't do any | 57 | /* If it is in one of the force entries, we don't do any |
59 | detection at all */ | 58 | detection at all */ |
60 | found = 0; | 59 | found = 0; |
61 | for (i = 0; !found && (this_force = address_data->forces + i, this_force->force); i++) { | 60 | for (i = 0; address_data->forces[i]; i++) { |
62 | for (j = 0; !found && (this_force->force[j] != I2C_CLIENT_END); j += 2) { | 61 | for (j = 0; !found && (address_data->forces[i][j] != I2C_CLIENT_END); j += 2) { |
63 | if ( ((adapter_id == this_force->force[j]) || | 62 | if ( ((adapter_id == address_data->forces[i][j]) || |
64 | (this_force->force[j] == ANY_I2C_BUS)) && | 63 | (address_data->forces[i][j] == ANY_I2C_BUS)) && |
65 | (addr == this_force->force[j + 1]) ) { | 64 | (addr == address_data->forces[i][j + 1]) ) { |
66 | dev_dbg(&adapter->dev, "found force parameter for adapter %d, addr %04x\n", adapter_id, addr); | 65 | dev_dbg(&adapter->dev, "found force parameter for adapter %d, addr %04x\n", adapter_id, addr); |
67 | if ((err = found_proc(adapter, addr, this_force->kind))) | 66 | if ((err = found_proc(adapter, addr, i))) |
68 | return err; | 67 | return err; |
69 | found = 1; | 68 | found = 1; |
70 | } | 69 | } |