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.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/drivers/base/platform.c b/drivers/base/platform.c
index 9e9227e1762d..eee48c49f5de 100644
--- a/drivers/base/platform.c
+++ b/drivers/base/platform.c
@@ -89,8 +89,13 @@ int platform_get_irq(struct platform_device *dev, unsigned int num)
89 return dev->archdata.irqs[num]; 89 return dev->archdata.irqs[num];
90#else 90#else
91 struct resource *r; 91 struct resource *r;
92 if (IS_ENABLED(CONFIG_OF_IRQ) && dev->dev.of_node) 92 if (IS_ENABLED(CONFIG_OF_IRQ) && dev->dev.of_node) {
93 return of_irq_get(dev->dev.of_node, num); 93 int ret;
94
95 ret = of_irq_get(dev->dev.of_node, num);
96 if (ret >= 0 || ret == -EPROBE_DEFER)
97 return ret;
98 }
94 99
95 r = platform_get_resource(dev, IORESOURCE_IRQ, num); 100 r = platform_get_resource(dev, IORESOURCE_IRQ, num);
96 101
@@ -133,8 +138,13 @@ int platform_get_irq_byname(struct platform_device *dev, const char *name)
133{ 138{
134 struct resource *r; 139 struct resource *r;
135 140
136 if (IS_ENABLED(CONFIG_OF_IRQ) && dev->dev.of_node) 141 if (IS_ENABLED(CONFIG_OF_IRQ) && dev->dev.of_node) {
137 return of_irq_get_byname(dev->dev.of_node, name); 142 int ret;
143
144 ret = of_irq_get_byname(dev->dev.of_node, name);
145 if (ret >= 0 || ret == -EPROBE_DEFER)
146 return ret;
147 }
138 148
139 r = platform_get_resource_byname(dev, IORESOURCE_IRQ, name); 149 r = platform_get_resource_byname(dev, IORESOURCE_IRQ, name);
140 return r ? r->start : -ENXIO; 150 return r ? r->start : -ENXIO;