summary refs log tree commit diff
diff options
context:
space:
mode:
authorToby Smith <toby@tismith.id.au>2014-04-30 18:01:40 +1000
committerLinus Walleij <linus.walleij@linaro.org>2014-05-09 12:55:26 +0200
commit3275d0723a4cfad2199905623202edaa1ecba8c2 (patch)
tree86e43ca7dcfa41b8b7b52a415bf70df7766a4324
parentdd640039e8de4135fd59d4d963487d1239d6fabe (diff)
downloadlinux-3275d0723a4cfad2199905623202edaa1ecba8c2.tar.gz
gpio: pca953x: return IRQ_NONE when appropriate
The irq handler should return IRQ_NONE or IRQ_HANDLED to report
if we have handled the interrupt.

Signed-off-by: Toby Smith <toby@tismith.id.au>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-rw-r--r--drivers/gpio/gpio-pca953x.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/gpio/gpio-pca953x.c b/drivers/gpio/gpio-pca953x.c
index d550d8e58705..83cc2c8f105f 100644
--- a/drivers/gpio/gpio-pca953x.c
+++ b/drivers/gpio/gpio-pca953x.c
@@ -503,10 +503,11 @@ static irqreturn_t pca953x_irq_handler(int irq, void *devid)
 	struct pca953x_chip *chip = devid;
 	u8 pending[MAX_BANK];
 	u8 level;
+	unsigned nhandled = 0;
 	int i;
 
 	if (!pca953x_irq_pending(chip, pending))
-		return IRQ_HANDLED;
+		return IRQ_NONE;
 
 	for (i = 0; i < NBANK(chip); i++) {
 		while (pending[i]) {
@@ -514,10 +515,11 @@ static irqreturn_t pca953x_irq_handler(int irq, void *devid)
 			handle_nested_irq(irq_find_mapping(chip->domain,
 							level + (BANK_SZ * i)));
 			pending[i] &= ~(1 << level);
+			nhandled++;
 		}
 	}
 
-	return IRQ_HANDLED;
+	return (nhandled > 0) ? IRQ_HANDLED : IRQ_NONE;
 }
 
 static int pca953x_gpio_irq_map(struct irq_domain *d, unsigned int irq,