From 4484d0b17982af8d7af2c21bcc67e47f4237ce70 Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Tue, 13 Nov 2012 15:31:41 +0800 Subject: 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: Axel Lin Acked-by: Viresh Kumar Signed-off-by: Linus Walleij --- drivers/pinctrl/spear/pinctrl-spear.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'drivers/pinctrl/spear') diff --git a/drivers/pinctrl/spear/pinctrl-spear.c b/drivers/pinctrl/spear/pinctrl-spear.c index 11bd8722a00..add933286e9 100644 --- a/drivers/pinctrl/spear/pinctrl-spear.c +++ b/drivers/pinctrl/spear/pinctrl-spear.c @@ -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; } -- cgit v1.2.3-70-g09d2