Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[firefly-linux-kernel-4.4.55.git] / drivers / base / platform.c
index 17f0204fabefe10af56bbf6cf67722ed61a73dd1..ebf034b97278592ab57cbd24ef0f53d3cfc56e0a 100644 (file)
@@ -101,6 +101,15 @@ int platform_get_irq(struct platform_device *dev, unsigned int num)
        }
 
        r = platform_get_resource(dev, IORESOURCE_IRQ, num);
+       /*
+        * The resources may pass trigger flags to the irqs that need
+        * to be set up. It so happens that the trigger flags for
+        * IORESOURCE_BITS correspond 1-to-1 to the IRQF_TRIGGER*
+        * settings.
+        */
+       if (r && r->flags & IORESOURCE_BITS)
+               irqd_set_trigger_type(irq_get_irq_data(r->start),
+                                     r->flags & IORESOURCE_BITS);
 
        return r ? r->start : -ENXIO;
 #endif