[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <q2t427d64721004120029n91bb5bcg1416b34dda1a28be@mail.gmail.com>
Date: Mon, 12 Apr 2010 15:29:16 +0800
From: Axel Lin <axel.lin@...il.com>
To: linux-kernel <linux-kernel@...r.kernel.org>
Cc: Eric Miao <eric.miao@...vell.com>
Subject: [PATCH] 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 <axel.lin@...il.com>
---
drivers/gpio/max732x.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/gpio/max732x.c b/drivers/gpio/max732x.c
index f786824..51b02c6 100644
--- a/drivers/gpio/max732x.c
+++ b/drivers/gpio/max732x.c
@@ -285,14 +285,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;
}
@@ -307,7 +307,7 @@ static int __devinit max732x_probe(struct
i2c_client *client,
mutex_init(&chip->lock);
max732x_read(chip, is_group_a(chip, 0), &chip->reg_out[0]);
- if (nr_port > 7)
+ if (nr_port > 8)
max732x_read(chip, is_group_a(chip, 8), &chip->reg_out[1]);
ret = gpiochip_add(&chip->gpio_chip);
--
1.5.4.3
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists