Commit 68491b07 authored by Linus Walleij's avatar Linus Walleij

gpio: ep93xx: Use for_each_set_bit() in IRQ handler

This simplifies and standardizes the AB IRQ handler by using
the for_each_set_bit() library function.
Acked-by: default avatarAlexander Sverdlin <alexander.sverdlin@gmail.com>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 51ba88e3
...@@ -105,25 +105,21 @@ static void ep93xx_gpio_ab_irq_handler(struct irq_desc *desc) ...@@ -105,25 +105,21 @@ static void ep93xx_gpio_ab_irq_handler(struct irq_desc *desc)
struct gpio_chip *gc = irq_desc_get_handler_data(desc); struct gpio_chip *gc = irq_desc_get_handler_data(desc);
struct ep93xx_gpio *epg = gpiochip_get_data(gc); struct ep93xx_gpio *epg = gpiochip_get_data(gc);
struct irq_chip *irqchip = irq_desc_get_chip(desc); struct irq_chip *irqchip = irq_desc_get_chip(desc);
unsigned char status; unsigned long stat;
int i; int offset;
chained_irq_enter(irqchip, desc); chained_irq_enter(irqchip, desc);
status = readb(epg->base + EP93XX_GPIO_A_INT_STATUS); stat = readb(epg->base + EP93XX_GPIO_A_INT_STATUS);
for (i = 0; i < 8; i++) { for_each_set_bit(offset, &stat, 8) {
if (status & (1 << i)) { int gpio_irq = gpio_to_irq(0) + offset;
int gpio_irq = gpio_to_irq(0) + i; generic_handle_irq(gpio_irq);
generic_handle_irq(gpio_irq);
}
} }
status = readb(epg->base + EP93XX_GPIO_B_INT_STATUS); stat = readb(epg->base + EP93XX_GPIO_B_INT_STATUS);
for (i = 0; i < 8; i++) { for_each_set_bit(offset, &stat, 8) {
if (status & (1 << i)) { int gpio_irq = gpio_to_irq(8) + offset;
int gpio_irq = gpio_to_irq(8) + i; generic_handle_irq(gpio_irq);
generic_handle_irq(gpio_irq);
}
} }
chained_irq_exit(irqchip, desc); chained_irq_exit(irqchip, desc);
......
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