Commit 9be93e1a authored by Andy Shevchenko's avatar Andy Shevchenko

gpio: pch: 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: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
parent 502ae42c
...@@ -313,16 +313,14 @@ static void pch_irq_ack(struct irq_data *d) ...@@ -313,16 +313,14 @@ static void pch_irq_ack(struct irq_data *d)
static irqreturn_t pch_gpio_handler(int irq, void *dev_id) static irqreturn_t pch_gpio_handler(int irq, void *dev_id)
{ {
struct pch_gpio *chip = dev_id; struct pch_gpio *chip = dev_id;
u32 reg_val = ioread32(&chip->reg->istatus); unsigned long reg_val = ioread32(&chip->reg->istatus);
int i, ret = IRQ_NONE; int i, ret = IRQ_NONE;
for (i = 0; i < gpio_pins[chip->ioh]; i++) { for_each_set_bit(i, &reg_val, gpio_pins[chip->ioh]) {
if (reg_val & BIT(i)) { dev_dbg(chip->dev, "%s:[%d]:irq=%d status=0x%lx\n", __func__,
dev_dbg(chip->dev, "%s:[%d]:irq=%d status=0x%x\n", i, irq, reg_val);
__func__, i, irq, reg_val); generic_handle_irq(chip->irq_base + i);
generic_handle_irq(chip->irq_base + i); ret = IRQ_HANDLED;
ret = IRQ_HANDLED;
}
} }
return ret; return ret;
} }
......
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