aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAxel Lin <[email protected]>2010-05-26 14:42:20 -0700
committerLinus Torvalds <[email protected]>2010-05-27 09:12:41 -0700
commit5535cb681c38bda94af02ef4b043a25b52303e65 (patch)
tree9ad66972714c55298a2d64e332b1211419421aa4
parentc1cc9b9775c931a0015178daf92d41aec00580de (diff)
max732x: correct nr_port checking off by one error
Setup both client_group_a and client_group_b if nr_port > 8 (not including nr_port==8). Signed-off-by: Axel Lin <[email protected]> Cc: Eric Miao <[email protected]> Cc: Ben Dooks <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
-rw-r--r--drivers/gpio/max732x.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/gpio/max732x.c b/drivers/gpio/max732x.c
index 2053ba9cbfae..26ff40110d9f 100644
--- a/drivers/gpio/max732x.c
+++ b/drivers/gpio/max732x.c
@@ -595,14 +595,14 @@ static int __devinit max732x_probe(struct i2c_client *client,
switch (client->addr & 0x70) {
case 0x60:
chip->client_group_a = client;
- if (nr_port > 7) {
+ if (nr_port > 8) {
c = i2c_new_dummy(client->adapter, addr_b);
chip->client_group_b = chip->client_dummy = c;
}
break;
case 0x50:
chip->client_group_b = client;
- if (nr_port > 7) {
+ if (nr_port > 8) {
c = i2c_new_dummy(client->adapter, addr_a);
chip->client_group_a = chip->client_dummy = c;
}
@@ -617,7 +617,7 @@ static int __devinit max732x_probe(struct i2c_client *client,
mutex_init(&chip->lock);
max732x_readb(chip, is_group_a(chip, 0), &chip->reg_out[0]);
- if (nr_port > 7)
+ if (nr_port > 8)
max732x_readb(chip, is_group_a(chip, 8), &chip->reg_out[1]);
ret = max732x_irq_setup(chip, id);