gpio: pch: Use in pch_irq_type() macros provided by IRQ core
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Tue, 14 Apr 2020 17:49:00 +0000 (20:49 +0300)
committerAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Thu, 16 Apr 2020 17:40:14 +0000 (20:40 +0300)
Use in pch_irq_type() the macros provided by IRQ core for IRQ type.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
drivers/gpio/gpio-pch.c

index 9c34230..e96d28b 100644 (file)
@@ -265,9 +265,9 @@ static int pch_irq_type(struct irq_data *d, unsigned int type)
        iowrite32(im | (val << (im_pos * 4)), im_reg);
 
        /* And the handler */
-       if (type & (IRQ_TYPE_LEVEL_LOW | IRQ_TYPE_LEVEL_HIGH))
+       if (type & IRQ_TYPE_LEVEL_MASK)
                irq_set_handler_locked(d, handle_level_irq);
-       else if (type & (IRQ_TYPE_EDGE_FALLING | IRQ_TYPE_EDGE_RISING))
+       else if (type & IRQ_TYPE_EDGE_BOTH)
                irq_set_handler_locked(d, handle_edge_irq);
 
        spin_unlock_irqrestore(&chip->spinlock, flags);