From: Alexandre Courbot Date: Sat, 23 Nov 2013 05:55:52 +0000 (+0900) Subject: gpiolib: fix lookup of platform-mapped GPIOs X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=7cc67b9c74d9728ba6cbf868d7bcd2cc24de0880;p=linux-beck.git gpiolib: fix lookup of platform-mapped GPIOs A typo resulted in GPIO lookup failing unconditionally. Signed-off-by: Alexandre Courbot Reported-by: Stephen Warren Reviewed-by: Mika Westerberg Signed-off-by: Linus Walleij --- diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c index ac53a9593662..b73c39f99858 100644 --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c @@ -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;