diff options
author | Haojian Zhuang <haojian.zhuang@linaro.org> | 2013-01-16 13:19:28 +0800 |
---|---|---|
committer | Guodong Xu <guodong.xu@linaro.org> | 2013-02-21 16:12:15 +0800 |
commit | 3aaeff9efe39a5fd42415c955bafd27912d10822 (patch) | |
tree | b5873005415a3f1c1494e251fefe7532f1db0315 | |
parent | c9e44ec80cd5e807f0181716b58b60e5a38b693f (diff) |
gpio: fix wrong checking condition for gpio range
Since index++ calculates from 0, the checking condition of "while
(index++)" is always fake. So replace it by unconditional loop.
Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
-rw-r--r-- | drivers/gpio/gpiolib-of.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c index b1f068260d8..011e1e98a8d 100644 --- a/drivers/gpio/gpiolib-of.c +++ b/drivers/gpio/gpiolib-of.c @@ -228,7 +228,7 @@ static void of_gpiochip_add_pin_range(struct gpio_chip *chip) if (!np) return; - do { + for (;;) { ret = of_parse_phandle_with_args(np, "gpio-ranges", "#gpio-range-cells", index, &pinspec); if (ret) @@ -254,8 +254,8 @@ static void of_gpiochip_add_pin_range(struct gpio_chip *chip) if (ret) break; - - } while (index++); + index++; + } } #else |