sh-pfc: r8a7740: Fix pin bias setup
authorLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Thu, 28 Nov 2013 15:20:03 +0000 (16:20 +0100)
committerLinus Walleij <linus.walleij@linaro.org>
Tue, 3 Dec 2013 09:38:39 +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-r8a7740.c

index 009174d07767ff71451ac70cb4ce4de8b50efdf1..bc5eb453a45ccfb7826e60825b75afed8de868a7 100644 (file)
@@ -3720,7 +3720,7 @@ static void __iomem *r8a7740_pinmux_portcr(struct sh_pfc *pfc, unsigned int pin)
                const struct r8a7740_portcr_group *group =
                        &r8a7740_portcr_offsets[i];
 
-               if (i <= group->end_pin)
+               if (pin <= group->end_pin)
                        return pfc->window->virt + group->offset + pin;
        }