diff options
Diffstat (limited to 'drivers/base/platform.c')
-rw-r--r-- | drivers/base/platform.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/base/platform.c b/drivers/base/platform.c index 8727e9c5eea4..72c776f2a1f5 100644 --- a/drivers/base/platform.c +++ b/drivers/base/platform.c | |||
@@ -83,9 +83,16 @@ EXPORT_SYMBOL_GPL(platform_get_resource); | |||
83 | */ | 83 | */ |
84 | int platform_get_irq(struct platform_device *dev, unsigned int num) | 84 | int platform_get_irq(struct platform_device *dev, unsigned int num) |
85 | { | 85 | { |
86 | #ifdef CONFIG_SPARC | ||
87 | /* sparc does not have irqs represented as IORESOURCE_IRQ resources */ | ||
88 | if (!dev || num >= dev->archdata.num_irqs) | ||
89 | return -ENXIO; | ||
90 | return dev->archdata.irqs[num]; | ||
91 | #else | ||
86 | struct resource *r = platform_get_resource(dev, IORESOURCE_IRQ, num); | 92 | struct resource *r = platform_get_resource(dev, IORESOURCE_IRQ, num); |
87 | 93 | ||
88 | return r ? r->start : -ENXIO; | 94 | return r ? r->start : -ENXIO; |
95 | #endif | ||
89 | } | 96 | } |
90 | EXPORT_SYMBOL_GPL(platform_get_irq); | 97 | EXPORT_SYMBOL_GPL(platform_get_irq); |
91 | 98 | ||