diff options
author | Jean Delvare <khali@linux-fr.org> | 2005-03-30 22:32:17 -0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2005-03-30 22:32:17 -0800 |
commit | 11543882368ecb38b880b4e3ae605be3d59371dd (patch) | |
tree | bfc73fdc3b4cd4cf20d3f88debc19b2664424bc5 | |
parent | 7343e7c77c30d385c0a4e0b4adfbd5bdbf647fdf (diff) | |
download | history-11543882368ecb38b880b4e3ae605be3d59371dd.tar.gz |
[PATCH] I2C: Fix broken force parameter handling
I just noticed a nasty bug in the way the "force" parameter is handled
for non-sensors i2c chip drivers. The "force" parameter supposedy is a
list of adapter, address *pairs* where supported chips are
unquestionably assumed to be. However, after handling one pair, the i2c
core code searches for the next one *three* values later, not two. So
with the current code, the second and third pairs wouldn't be properly
handled. The fourth one would be, and so on.
As a side note, this questions the need of an array parameter handling
up to 24 of such pairs, when obviously nobody ever required more than
one for the past 6 years.
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r-- | drivers/i2c/i2c-core.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c index 474ddb6fe25235..e62a91a45a291e 100644 --- a/drivers/i2c/i2c-core.c +++ b/drivers/i2c/i2c-core.c @@ -715,7 +715,7 @@ int i2c_probe(struct i2c_adapter *adapter, at all */ found = 0; - for (i = 0; !found && (address_data->force[i] != I2C_CLIENT_END); i += 3) { + for (i = 0; !found && (address_data->force[i] != I2C_CLIENT_END); i += 2) { if (((adap_id == address_data->force[i]) || (address_data->force[i] == ANY_I2C_BUS)) && (addr == address_data->force[i+1])) { |