]> git.sur5r.net Git - u-boot/commitdiff
M28: Fix OB1 bug in GPIO driver
authorRobert Deliën <Robert@delien.nl>
Tue, 22 Nov 2011 04:14:22 +0000 (04:14 +0000)
committerAlbert ARIBAUD <albert.u.boot@aribaud.net>
Tue, 6 Dec 2011 22:59:40 +0000 (23:59 +0100)
This patch fixes a small off-by-one bug in the GPIO driver for the mxs platform that allowed the selection gpio pins of one bank more than the SoC actually has.

Signed-off-by: Robert Deliën <robert at delien.nl>
Acked-by: Marek Vasut <marek.vasut@gmail.com>
Acked-by: Marek Vasut <marek.vasut@gmail.com>
drivers/gpio/mxs_gpio.c

index b7e959128e8e8b40f4da2bc8c87f259f28136aff..539738be9b5a38df0085412aa2253f5f9f3630cc 100644 (file)
@@ -120,7 +120,7 @@ int gpio_direction_output(int gp, int value)
 
 int gpio_request(int gp, const char *label)
 {
-       if (PAD_BANK(gp) > PINCTRL_BANKS)
+       if (PAD_BANK(gp) >= PINCTRL_BANKS)
                return -EINVAL;
 
        return 0;