]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
pinctrl: spear: Fix the logic of setting reg in pmx_init_gpio_pingroup_addr
authorAxel Lin <axel.lin@ingics.com>
Tue, 13 Nov 2012 07:31:41 +0000 (15:31 +0800)
committerLinus Walleij <linus.walleij@linaro.org>
Thu, 15 Nov 2012 11:05:40 +0000 (12:05 +0100)
Current code does not work if count > 1, fix it.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/spear/pinctrl-spear.c

index 11bd8722a00798ed7283b9aedfd3f959295620aa..add933286e94f43951521e8c04a80584a5d66e5e 100644 (file)
@@ -86,10 +86,10 @@ void __devinit
 pmx_init_gpio_pingroup_addr(struct spear_gpio_pingroup *gpio_pingroup,
                unsigned count, u16 reg)
 {
-       int i = 0, j = 0;
+       int i, j;
 
-       for (; i < count; i++)
-               for (; j < gpio_pingroup[i].nmuxregs; j++)
+       for (i = 0; i < count; i++)
+               for (j = 0; j < gpio_pingroup[i].nmuxregs; j++)
                        gpio_pingroup[i].muxregs[j].reg = reg;
 }