diff options
author | Axel Lin <axel.lin@ingics.com> | 2012-11-13 02:31:41 -0500 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2012-11-15 06:05:40 -0500 |
commit | 4484d0b17982af8d7af2c21bcc67e47f4237ce70 (patch) | |
tree | 6264d5dde0232d88bed793785ea1980827866950 /drivers/pinctrl/spear | |
parent | 8d1c6ef67a4530ee5dbd5038d2959a54593013b1 (diff) |
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 <axel.lin@ingics.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl/spear')
-rw-r--r-- | drivers/pinctrl/spear/pinctrl-spear.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/pinctrl/spear/pinctrl-spear.c b/drivers/pinctrl/spear/pinctrl-spear.c index 11bd8722a007..add933286e94 100644 --- a/drivers/pinctrl/spear/pinctrl-spear.c +++ b/drivers/pinctrl/spear/pinctrl-spear.c | |||
@@ -86,10 +86,10 @@ void __devinit | |||
86 | pmx_init_gpio_pingroup_addr(struct spear_gpio_pingroup *gpio_pingroup, | 86 | pmx_init_gpio_pingroup_addr(struct spear_gpio_pingroup *gpio_pingroup, |
87 | unsigned count, u16 reg) | 87 | unsigned count, u16 reg) |
88 | { | 88 | { |
89 | int i = 0, j = 0; | 89 | int i, j; |
90 | 90 | ||
91 | for (; i < count; i++) | 91 | for (i = 0; i < count; i++) |
92 | for (; j < gpio_pingroup[i].nmuxregs; j++) | 92 | for (j = 0; j < gpio_pingroup[i].nmuxregs; j++) |
93 | gpio_pingroup[i].muxregs[j].reg = reg; | 93 | gpio_pingroup[i].muxregs[j].reg = reg; |
94 | } | 94 | } |
95 | 95 | ||