gpio: dwapb: Switch to use fwnode_irq_get()
[linux-2.6-microblaze.git] / drivers / gpio / gpio-dwapb.c
index d3233cc..7d61f58 100644 (file)
@@ -297,9 +297,6 @@ static int dwapb_irq_set_type(struct irq_data *d, u32 type)
        irq_hw_number_t bit = irqd_to_hwirq(d);
        unsigned long level, polarity, flags;
 
-       if (type & ~IRQ_TYPE_SENSE_MASK)
-               return -EINVAL;
-
        spin_lock_irqsave(&gc->bgpio_lock, flags);
        level = dwapb_read(gpio, GPIO_INTTYPE_LEVEL);
        polarity = dwapb_read(gpio, GPIO_INT_POLARITY);
@@ -531,17 +528,13 @@ static int dwapb_gpio_add_port(struct dwapb_gpio *gpio,
 static void dwapb_get_irq(struct device *dev, struct fwnode_handle *fwnode,
                          struct dwapb_port_property *pp)
 {
-       struct device_node *np = NULL;
-       int irq = -ENXIO, j;
-
-       if (fwnode_property_read_bool(fwnode, "interrupt-controller"))
-               np = to_of_node(fwnode);
+       int irq, j;
 
        for (j = 0; j < pp->ngpio; j++) {
-               if (np)
-                       irq = of_irq_get(np, j);
-               else if (has_acpi_companion(dev))
+               if (has_acpi_companion(dev))
                        irq = platform_get_irq_optional(to_platform_device(dev), j);
+               else
+                       irq = fwnode_irq_get(fwnode, j);
                if (irq > 0)
                        pp->irq[j] = irq;
        }