From: Kuppuswamy Sathyanarayanan Date: Fri, 14 Apr 2017 17:29:25 +0000 (-0700) Subject: gpio: gpio-wcove: fix irq pending status bit width X-Git-Tag: v4.12-rc1~100^2~9 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=7c2d176fe3f8dce632b948f79c7e89916ffe2c70;p=karo-tx-linux.git gpio: gpio-wcove: fix irq pending status bit width 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 Signed-off-by: Linus Walleij --- diff --git a/drivers/gpio/gpio-wcove.c b/drivers/gpio/gpio-wcove.c index 97613de5304e..bf7b71d7cf5b 100644 --- a/drivers/gpio/gpio-wcove.c +++ b/drivers/gpio/gpio-wcove.c @@ -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);