summaryrefslogtreecommitdiff
path: root/drivers/base/platform.c
diff options
context:
space:
mode:
authorGrygorii Strashko <grygorii.strashko@ti.com>2014-05-20 13:42:02 +0300
committerGrant Likely <grant.likely@linaro.org>2014-05-23 11:40:25 +0900
commitad69674e73a18dc3a8da557f4059ccf9389531a5 (patch)
treef93c7f4cbcc191d6924fedfcef26af76063032c0 /drivers/base/platform.c
parentae91ff72e9132abe47f726424d9420fce004ca04 (diff)
of/irq: do irq resolution in platform_get_irq_byname()
The commit 9ec36cafe43bf835f8f29273597a5b0cbc8267ef "of/irq: do irq resolution in platform_get_irq" from Rob Herring - moves resolving of the interrupt resources in platform_get_irq(). But this solution isn't complete because platform_get_irq_byname() need to be modified the same way. Hence, fix it by adding interrupt resolution code at the platform_get_irq_byname() function too. Cc: Russell King <linux@arm.linux.org.uk> Cc: Rob Herring <robh@kernel.org> Cc: Tony Lindgren <tony@atomide.com> Cc: Grant Likely <grant.likely@linaro.org> Cc: Thierry Reding <thierry.reding@gmail.com> Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com> Signed-off-by: Grant Likely <grant.likely@linaro.org>
Diffstat (limited to 'drivers/base/platform.c')
-rw-r--r--drivers/base/platform.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/base/platform.c b/drivers/base/platform.c
index 5b47210889e0..9e9227e1762d 100644
--- a/drivers/base/platform.c
+++ b/drivers/base/platform.c
@@ -131,9 +131,12 @@ EXPORT_SYMBOL_GPL(platform_get_resource_byname);
*/
int platform_get_irq_byname(struct platform_device *dev, const char *name)
{
- struct resource *r = platform_get_resource_byname(dev, IORESOURCE_IRQ,
- name);
+ struct resource *r;
+
+ if (IS_ENABLED(CONFIG_OF_IRQ) && dev->dev.of_node)
+ return of_irq_get_byname(dev->dev.of_node, name);
+ r = platform_get_resource_byname(dev, IORESOURCE_IRQ, name);
return r ? r->start : -ENXIO;
}
EXPORT_SYMBOL_GPL(platform_get_irq_byname);