aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base/platform.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/base/platform.c')
-rw-r--r--drivers/base/platform.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/base/platform.c b/drivers/base/platform.c
index e714709704e4..5b47210889e0 100644
--- a/drivers/base/platform.c
+++ b/drivers/base/platform.c
@@ -13,6 +13,7 @@
13#include <linux/string.h> 13#include <linux/string.h>
14#include <linux/platform_device.h> 14#include <linux/platform_device.h>
15#include <linux/of_device.h> 15#include <linux/of_device.h>
16#include <linux/of_irq.h>
16#include <linux/module.h> 17#include <linux/module.h>
17#include <linux/init.h> 18#include <linux/init.h>
18#include <linux/dma-mapping.h> 19#include <linux/dma-mapping.h>
@@ -87,7 +88,11 @@ int platform_get_irq(struct platform_device *dev, unsigned int num)
87 return -ENXIO; 88 return -ENXIO;
88 return dev->archdata.irqs[num]; 89 return dev->archdata.irqs[num];
89#else 90#else
90 struct resource *r = platform_get_resource(dev, IORESOURCE_IRQ, num); 91 struct resource *r;
92 if (IS_ENABLED(CONFIG_OF_IRQ) && dev->dev.of_node)
93 return of_irq_get(dev->dev.of_node, num);
94
95 r = platform_get_resource(dev, IORESOURCE_IRQ, num);
91 96
92 return r ? r->start : -ENXIO; 97 return r ? r->start : -ENXIO;
93#endif 98#endif