diff options
author | Toby Smith <toby@tismith.id.au> | 2014-04-30 04:01:40 -0400 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2014-05-09 06:55:26 -0400 |
commit | 3275d0723a4cfad2199905623202edaa1ecba8c2 (patch) | |
tree | 86e43ca7dcfa41b8b7b52a415bf70df7766a4324 /drivers/gpio | |
parent | dd640039e8de4135fd59d4d963487d1239d6fabe (diff) |
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>
Diffstat (limited to 'drivers/gpio')
-rw-r--r-- | drivers/gpio/gpio-pca953x.c | 6 |
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) | |||
503 | struct pca953x_chip *chip = devid; | 503 | struct pca953x_chip *chip = devid; |
504 | u8 pending[MAX_BANK]; | 504 | u8 pending[MAX_BANK]; |
505 | u8 level; | 505 | u8 level; |
506 | unsigned nhandled = 0; | ||
506 | int i; | 507 | int i; |
507 | 508 | ||
508 | if (!pca953x_irq_pending(chip, pending)) | 509 | if (!pca953x_irq_pending(chip, pending)) |
509 | return IRQ_HANDLED; | 510 | return IRQ_NONE; |
510 | 511 | ||
511 | for (i = 0; i < NBANK(chip); i++) { | 512 | for (i = 0; i < NBANK(chip); i++) { |
512 | while (pending[i]) { | 513 | while (pending[i]) { |
@@ -514,10 +515,11 @@ static irqreturn_t pca953x_irq_handler(int irq, void *devid) | |||
514 | handle_nested_irq(irq_find_mapping(chip->domain, | 515 | handle_nested_irq(irq_find_mapping(chip->domain, |
515 | level + (BANK_SZ * i))); | 516 | level + (BANK_SZ * i))); |
516 | pending[i] &= ~(1 << level); | 517 | pending[i] &= ~(1 << level); |
518 | nhandled++; | ||
517 | } | 519 | } |
518 | } | 520 | } |
519 | 521 | ||
520 | return IRQ_HANDLED; | 522 | return (nhandled > 0) ? IRQ_HANDLED : IRQ_NONE; |
521 | } | 523 | } |
522 | 524 | ||
523 | static int pca953x_gpio_irq_map(struct irq_domain *d, unsigned int irq, | 525 | static int pca953x_gpio_irq_map(struct irq_domain *d, unsigned int irq, |