diff options
author | Grygorii Strashko <grygorii.strashko@ti.com> | 2014-05-20 06:42:02 -0400 |
---|---|---|
committer | Grant Likely <grant.likely@linaro.org> | 2014-05-22 22:40:25 -0400 |
commit | ad69674e73a18dc3a8da557f4059ccf9389531a5 (patch) | |
tree | f93c7f4cbcc191d6924fedfcef26af76063032c0 /drivers/of | |
parent | ae91ff72e9132abe47f726424d9420fce004ca04 (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/of')
-rw-r--r-- | drivers/of/irq.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/drivers/of/irq.c b/drivers/of/irq.c index 5aeb89411350..3e06a699352d 100644 --- a/drivers/of/irq.c +++ b/drivers/of/irq.c | |||
@@ -406,6 +406,28 @@ int of_irq_get(struct device_node *dev, int index) | |||
406 | } | 406 | } |
407 | 407 | ||
408 | /** | 408 | /** |
409 | * of_irq_get_byname - Decode a node's IRQ and return it as a Linux irq number | ||
410 | * @dev: pointer to device tree node | ||
411 | * @name: irq name | ||
412 | * | ||
413 | * Returns Linux irq number on success, or -EPROBE_DEFER if the irq domain | ||
414 | * is not yet created, or error code in case of any other failure. | ||
415 | */ | ||
416 | int of_irq_get_byname(struct device_node *dev, const char *name) | ||
417 | { | ||
418 | int index; | ||
419 | |||
420 | if (unlikely(!name)) | ||
421 | return -EINVAL; | ||
422 | |||
423 | index = of_property_match_string(dev, "interrupt-names", name); | ||
424 | if (index < 0) | ||
425 | return index; | ||
426 | |||
427 | return of_irq_get(dev, index); | ||
428 | } | ||
429 | |||
430 | /** | ||
409 | * of_irq_count - Count the number of IRQs a node uses | 431 | * of_irq_count - Count the number of IRQs a node uses |
410 | * @dev: pointer to device tree node | 432 | * @dev: pointer to device tree node |
411 | */ | 433 | */ |