Commit 3275d072 authored by Toby Smith's avatar Toby Smith Committed by Linus Walleij

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: default avatarToby Smith <toby@tismith.id.au>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent dd640039
...@@ -503,10 +503,11 @@ static irqreturn_t pca953x_irq_handler(int irq, void *devid) ...@@ -503,10 +503,11 @@ static irqreturn_t pca953x_irq_handler(int irq, void *devid)
struct pca953x_chip *chip = devid; struct pca953x_chip *chip = devid;
u8 pending[MAX_BANK]; u8 pending[MAX_BANK];
u8 level; u8 level;
unsigned nhandled = 0;
int i; int i;
if (!pca953x_irq_pending(chip, pending)) if (!pca953x_irq_pending(chip, pending))
return IRQ_HANDLED; return IRQ_NONE;
for (i = 0; i < NBANK(chip); i++) { for (i = 0; i < NBANK(chip); i++) {
while (pending[i]) { while (pending[i]) {
...@@ -514,10 +515,11 @@ static irqreturn_t pca953x_irq_handler(int irq, void *devid) ...@@ -514,10 +515,11 @@ static irqreturn_t pca953x_irq_handler(int irq, void *devid)
handle_nested_irq(irq_find_mapping(chip->domain, handle_nested_irq(irq_find_mapping(chip->domain,
level + (BANK_SZ * i))); level + (BANK_SZ * i)));
pending[i] &= ~(1 << level); 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, static int pca953x_gpio_irq_map(struct irq_domain *d, unsigned int irq,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment