sh-pfc: sh7372: Fix pin bias setup
authorLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Thu, 28 Nov 2013 15:20:04 +0000 (16:20 +0100)
committerLinus Walleij <linus.walleij@linaro.org>
Tue, 3 Dec 2013 09:38:41 +0000 (10:38 +0100)
When computing the pin configuration register offset the bias setup code
erroneously compares the pin number range with the loop index instead of
the pin number. Fix it.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/sh-pfc/pfc-sh7372.c

index 70b522d348218e43dad2952f9c54b3c90c18c215..cc097b6938208ea029902f8dc2f68af548f9429a 100644 (file)
@@ -2584,7 +2584,7 @@ static void __iomem *sh7372_pinmux_portcr(struct sh_pfc *pfc, unsigned int pin)
                const struct sh7372_portcr_group *group =
                        &sh7372_portcr_offsets[i];
 
-               if (i <= group->end_pin)
+               if (pin <= group->end_pin)
                        return pfc->window->virt + group->offset + pin;
        }