Skip to contentSkip to conversation

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

PATCH In review Axel Lin 2 participants 2 messages Nov 13, 2012 – Nov 15, 2012

Subsystems (2)
lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 pinctrl: spear: Fix the logic of setting reg in pmx_init_gpio_pingroup_addr

Current code does not work if count > 1, fix it.

---
 drivers/pinctrl/spear/pinctrl-spear.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/pinctrl/spear/pinctrl-spear.c +3 -3
index f9483ae..107780c 100644
@@ -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;
 }
 
Signature · 1 line
1.7.9.5