mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
gpio: fix wrong checking condition for gpio range
If index++ calculates from 0, the checking condition of "while (index++)" fails & it doesn't check any more. It doesn't follow the loop that used at here. Replace it by endless loop at here. Then it keeps parsing "gpio-ranges" property until it ends. Signed-off-by: Haojian Zhuang <[email protected]> Reviewed-by: Linus Walleij <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
This commit is contained in:
parent
6dbe51c251
commit
ad4e1a7caf
1 changed files with 2 additions and 3 deletions
|
|
@ -193,7 +193,7 @@ static void of_gpiochip_add_pin_range(struct gpio_chip *chip)
|
|||
if (!np)
|
||||
return;
|
||||
|
||||
do {
|
||||
for (;; index++) {
|
||||
ret = of_parse_phandle_with_args(np, "gpio-ranges",
|
||||
"#gpio-range-cells", index, &pinspec);
|
||||
if (ret)
|
||||
|
|
@ -222,8 +222,7 @@ static void of_gpiochip_add_pin_range(struct gpio_chip *chip)
|
|||
|
||||
if (ret)
|
||||
break;
|
||||
|
||||
} while (index++);
|
||||
}
|
||||
}
|
||||
|
||||
#else
|
||||
|
|
|
|||
Loading…
Reference in a new issue