[PATCH] I2C updates: Fix an iteration bug in the handling of i2c client module parameters.
Linux Kernel Mailing List <[email protected]> Fri, 06 May 2005 22:02:44 +0000
| Newsgroups | gmane.linux.kernel.commits.2-4 |
|---|---|
| Message-ID | <[email protected]> |
ChangeSet 1.1514, 2005/05/06 19:02:44-03:00, [email protected] [PATCH] I2C updates: Fix an iteration bug in the handling of i2c client module parameters. Fix an iteration bug in the handling of i2c client module parameters. The "force" module parameter is a list of adapter, address pairs, not triplets. The current code would only handle the first, fourth, seventh etc. pairs properly. I guess that nobody ever needed more than one pair, or the bug would have been noticed way earlier. This bug was originally fixed by myself in Linux 2.6. http://marc.theaimsgroup.com/?l=linux-kernel&m=111231616107325 http://linux.bkbits.net:8080/linux-2.5/diffs/drivers/i2c/[email protected] i2c-core.c | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) diff -Nru a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c --- a/drivers/i2c/i2c-core.c 2005-05-06 20:02:01 -07:00 +++ b/drivers/i2c/i2c-core.c 2005-05-06 20:02:01 -07:00 @@ -851,7 +851,7 @@ 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])) {