Commit 4484d0b1 authored by Axel Lin's avatar Axel Lin Committed by Linus Walleij

pinctrl: spear: Fix the logic of setting reg in pmx_init_gpio_pingroup_addr

Current code does not work if count > 1, fix it.
Signed-off-by: default avatarAxel Lin <axel.lin@ingics.com>
Acked-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 8d1c6ef6
...@@ -86,10 +86,10 @@ void __devinit ...@@ -86,10 +86,10 @@ void __devinit
pmx_init_gpio_pingroup_addr(struct spear_gpio_pingroup *gpio_pingroup, pmx_init_gpio_pingroup_addr(struct spear_gpio_pingroup *gpio_pingroup,
unsigned count, u16 reg) unsigned count, u16 reg)
{ {
int i = 0, j = 0; int i, j;
for (; i < count; i++) for (i = 0; i < count; i++)
for (; j < gpio_pingroup[i].nmuxregs; j++) for (j = 0; j < gpio_pingroup[i].nmuxregs; j++)
gpio_pingroup[i].muxregs[j].reg = reg; gpio_pingroup[i].muxregs[j].reg = reg;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment