]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
gpio: gpio-wcove: fix irq pending status bit width
authorKuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
Fri, 14 Apr 2017 17:29:25 +0000 (10:29 -0700)
committerLinus Walleij <linus.walleij@linaro.org>
Mon, 24 Apr 2017 13:14:17 +0000 (15:14 +0200)
Whiskey cove PMIC has three GPIO banks with total number of 13 GPIO
pins. But when checking for the pending status, for_each_set_bit() uses
bit width of 7 and hence it only checks the status for first 7 GPIO pins
missing to check/clear the status of rest of the GPIO pins. This patch
fixes this issue.

Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/gpio/gpio-wcove.c

index 97613de5304e27fc0ee89d6f63c26bbfcb19d71e..bf7b71d7cf5bf60425927a2168418f42f3714180 100644 (file)
@@ -317,7 +317,7 @@ static irqreturn_t wcove_gpio_irq_handler(int irq, void *data)
        while (pending) {
                /* One iteration is for all pending bits */
                for_each_set_bit(gpio, (const unsigned long *)&pending,
-                                                GROUP0_NR_IRQS) {
+                                                WCOVE_GPIO_NUM) {
                        offset = (gpio > GROUP0_NR_IRQS) ? 1 : 0;
                        mask = (offset == 1) ? BIT(gpio - GROUP0_NR_IRQS) :
                                                                BIT(gpio);