diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2018-11-06 14:38:55 +0200 |
---|---|---|
committer | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2018-12-07 16:54:16 +0200 |
commit | f3af44f052272b815a2803b8205acfce393ee352 (patch) | |
tree | aa9c46d4e543629d2f8b887a9009ead247f38b2b /drivers/gpio | |
parent | 9be93e1ab73f34953971cb1b92e79826aa274055 (diff) | |
download | linux-f3af44f052272b815a2803b8205acfce393ee352.tar.bz2 |
gpio: sodaville: 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-sodaville.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/gpio/gpio-sodaville.c b/drivers/gpio/gpio-sodaville.c index 633f363946b7..bb21214461d2 100644 --- a/drivers/gpio/gpio-sodaville.c +++ b/drivers/gpio/gpio-sodaville.c @@ -80,18 +80,15 @@ static int sdv_gpio_pub_set_type(struct irq_data *d, unsigned int type) static irqreturn_t sdv_gpio_pub_irq_handler(int irq, void *data) { struct sdv_gpio_chip_data *sd = data; - u32 irq_stat = readl(sd->gpio_pub_base + GPSTR); + unsigned long irq_stat = readl(sd->gpio_pub_base + GPSTR); + int irq_bit; irq_stat &= readl(sd->gpio_pub_base + GPIO_INT); if (!irq_stat) return IRQ_NONE; - while (irq_stat) { - u32 irq_bit = __fls(irq_stat); - - irq_stat &= ~BIT(irq_bit); + for_each_set_bit(irq_bit, &irq_stat, 32) generic_handle_irq(irq_find_mapping(sd->id, irq_bit)); - } return IRQ_HANDLED; } |