summaryrefslogtreecommitdiffstats
path: root/drivers/gpio
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2018-11-06 13:38:55 +0100
committerAndy Shevchenko <andriy.shevchenko@linux.intel.com>2018-12-07 15:54:16 +0100
commitf3af44f052272b815a2803b8205acfce393ee352 (patch)
treeaa9c46d4e543629d2f8b887a9009ead247f38b2b /drivers/gpio
parentgpio: pch: Use for_each_set_bit() in IRQ handler (diff)
downloadlinux-f3af44f052272b815a2803b8205acfce393ee352.tar.xz
linux-f3af44f052272b815a2803b8205acfce393ee352.zip
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.c9
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;
}