struct gpio_chip *gc = irq_desc_get_handler_data(desc);
struct ep93xx_gpio *epg = gpiochip_get_data(gc);
struct irq_chip *irqchip = irq_desc_get_chip(desc);
- unsigned char status;
- int i;
+ unsigned long stat;
+ int offset;
chained_irq_enter(irqchip, desc);
- status = readb(epg->base + EP93XX_GPIO_A_INT_STATUS);
- for (i = 0; i < 8; i++) {
- if (status & (1 << i)) {
- int gpio_irq = gpio_to_irq(0) + i;
- generic_handle_irq(gpio_irq);
- }
+ stat = readb(epg->base + EP93XX_GPIO_A_INT_STATUS);
+ for_each_set_bit(offset, &stat, 8) {
+ int gpio_irq = gpio_to_irq(0) + offset;
+ generic_handle_irq(gpio_irq);
}
- status = readb(epg->base + EP93XX_GPIO_B_INT_STATUS);
- for (i = 0; i < 8; i++) {
- if (status & (1 << i)) {
- int gpio_irq = gpio_to_irq(8) + i;
- generic_handle_irq(gpio_irq);
- }
+ stat = readb(epg->base + EP93XX_GPIO_B_INT_STATUS);
+ for_each_set_bit(offset, &stat, 8) {
+ int gpio_irq = gpio_to_irq(8) + offset;
+ generic_handle_irq(gpio_irq);
}
chained_irq_exit(irqchip, desc);