[PATCH] gpio: 104-idio-16: Return IRQ_NONE if all relevant GPIO lines are masked

From: William Breathitt Gray
Date: Wed Jan 20 2016 - 13:20:59 EST


If the irq_mask member has a value of 0, then interrupts are disabled on
the device. Therefore, IRQ_NONE should be returned if the irq_mask
member is 0.

Signed-off-by: William Breathitt Gray <vilhelm.gray@xxxxxxxxx>
---
drivers/gpio/gpio-104-idio-16.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/gpio/gpio-104-idio-16.c b/drivers/gpio/gpio-104-idio-16.c
index 4d69b50..09fe032 100644
--- a/drivers/gpio/gpio-104-idio-16.c
+++ b/drivers/gpio/gpio-104-idio-16.c
@@ -175,6 +175,9 @@ static irqreturn_t idio_16_irq_handler(int irq, void *dev_id)
struct gpio_chip *const chip = &idio16gpio->chip;
int gpio;

+ if (!idio16gpio->irq_mask)
+ return IRQ_NONE;
+
for_each_set_bit(gpio, &idio16gpio->irq_mask, chip->ngpio)
generic_handle_irq(irq_find_mapping(chip->irqdomain, gpio));

--
2.4.10