diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2018-11-06 13:38:55 +0100 |
---|---|---|
committer | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2018-12-07 15:40:24 +0100 |
commit | 9be93e1ab73f34953971cb1b92e79826aa274055 (patch) | |
tree | 5f6bf30852c5619d03a9fd28cc40f76d82bcaba9 /drivers/gpio | |
parent | gpio: lynxpoint: Use for_each_set_bit() in IRQ handler (diff) | |
download | linux-9be93e1ab73f34953971cb1b92e79826aa274055.tar.xz linux-9be93e1ab73f34953971cb1b92e79826aa274055.zip |
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: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Diffstat (limited to 'drivers/gpio')
-rw-r--r-- | drivers/gpio/gpio-pch.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/drivers/gpio/gpio-pch.c b/drivers/gpio/gpio-pch.c index 350f95fa7bc9..ebecb8ad88ab 100644 --- a/drivers/gpio/gpio-pch.c +++ b/drivers/gpio/gpio-pch.c @@ -313,16 +313,14 @@ static void pch_irq_ack(struct irq_data *d) static irqreturn_t pch_gpio_handler(int irq, void *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; - for (i = 0; i < gpio_pins[chip->ioh]; i++) { - if (reg_val & BIT(i)) { - dev_dbg(chip->dev, "%s:[%d]:irq=%d status=0x%x\n", - __func__, i, irq, reg_val); - generic_handle_irq(chip->irq_base + i); - ret = IRQ_HANDLED; - } + for_each_set_bit(i, ®_val, gpio_pins[chip->ioh]) { + dev_dbg(chip->dev, "%s:[%d]:irq=%d status=0x%lx\n", __func__, + i, irq, reg_val); + generic_handle_irq(chip->irq_base + i); + ret = IRQ_HANDLED; } return ret; } |