gpio: crystalcove: 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. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
This commit is contained in:
parent
bfeffd1552
commit
fcce88d9ca
|
@ -279,8 +279,8 @@ static struct irq_chip crystalcove_irqchip = {
|
||||||
static irqreturn_t crystalcove_gpio_irq_handler(int irq, void *data)
|
static irqreturn_t crystalcove_gpio_irq_handler(int irq, void *data)
|
||||||
{
|
{
|
||||||
struct crystalcove_gpio *cg = data;
|
struct crystalcove_gpio *cg = data;
|
||||||
|
unsigned long pending;
|
||||||
unsigned int p0, p1;
|
unsigned int p0, p1;
|
||||||
int pending;
|
|
||||||
int gpio;
|
int gpio;
|
||||||
unsigned int virq;
|
unsigned int virq;
|
||||||
|
|
||||||
|
@ -293,12 +293,10 @@ static irqreturn_t crystalcove_gpio_irq_handler(int irq, void *data)
|
||||||
|
|
||||||
pending = p0 | p1 << 8;
|
pending = p0 | p1 << 8;
|
||||||
|
|
||||||
for (gpio = 0; gpio < CRYSTALCOVE_GPIO_NUM; gpio++) {
|
for_each_set_bit(gpio, &pending, CRYSTALCOVE_GPIO_NUM) {
|
||||||
if (pending & BIT(gpio)) {
|
|
||||||
virq = irq_find_mapping(cg->chip.irq.domain, gpio);
|
virq = irq_find_mapping(cg->chip.irq.domain, gpio);
|
||||||
handle_nested_irq(virq);
|
handle_nested_irq(virq);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return IRQ_HANDLED;
|
return IRQ_HANDLED;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue