gpiolib: fix lookup of platform-mapped GPIOs
authorAlexandre Courbot <acourbot@nvidia.com>
Sat, 23 Nov 2013 05:55:52 +0000 (14:55 +0900)
committerLinus Walleij <linus.walleij@linaro.org>
Tue, 3 Dec 2013 12:10:48 +0000 (13:10 +0100)
A typo resulted in GPIO lookup failing unconditionally.

Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Reported-by: Stephen Warren <swarren@wwwdotorg.org>
Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/gpio/gpiolib.c

index ac53a95936626800143d1ad30320329f0f3ec050..b73c39f998588388ed58bb10c5d376406572acc5 100644 (file)
@@ -2368,7 +2368,7 @@ static struct gpio_desc *gpiod_find(struct device *dev, const char *con_id,
                                continue;
                        }
 
-                       if (chip->ngpio >= p->chip_hwnum) {
+                       if (chip->ngpio <= p->chip_hwnum) {
                                dev_warn(dev, "GPIO chip %s has %d GPIOs\n",
                                         chip->label, chip->ngpio);
                                continue;