diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-11-14 15:01:02 -0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-11-14 15:01:02 -0800 |
commit | ecdca043ebe8e3172e0400d0966831e2e60870a0 (patch) | |
tree | c1433e2399f544970e1f9ae7a469dbc9172c8e9f /drivers/base/platform.c | |
parent | bb3215e97bb1ab917ed858322a9399fb32e69e49 (diff) | |
parent | 77b67063bb6bce6d475e910d3b886a606d0d91f7 (diff) | |
download | linux-3.10-ecdca043ebe8e3172e0400d0966831e2e60870a0.tar.gz linux-3.10-ecdca043ebe8e3172e0400d0966831e2e60870a0.tar.bz2 linux-3.10-ecdca043ebe8e3172e0400d0966831e2e60870a0.zip |
Merge 3.7-rc5 into driver-core-next
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 af1d47f0e99..1e8f65420db 100644 --- a/drivers/base/platform.c +++ b/drivers/base/platform.c @@ -83,9 +83,16 @@ EXPORT_SYMBOL_GPL(platform_get_resource); */ int platform_get_irq(struct platform_device *dev, unsigned int num) { +#ifdef CONFIG_SPARC + /* sparc does not have irqs represented as IORESOURCE_IRQ resources */ + if (!dev || num >= dev->archdata.num_irqs) + return -ENXIO; + return dev->archdata.irqs[num]; +#else struct resource *r = platform_get_resource(dev, IORESOURCE_IRQ, num); return r ? r->start : -ENXIO; +#endif } EXPORT_SYMBOL_GPL(platform_get_irq); |