of/irq: do irq resolution in platform_get_irq_byname()

The commit 9ec36cafe4
"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 <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: Tony Lindgren <[email protected]>
Cc: Grant Likely <[email protected]>
Cc: Thierry Reding <[email protected]>

Signed-off-by: Grygorii Strashko <[email protected]>
Signed-off-by: Grant Likely <[email protected]>
This commit is contained in:
Grygorii Strashko 2014-05-20 13:42:02 +03:00 • committed by Grant Likely
commit ad69674e73
3 changed files with 32 additions and 2 deletions

View file

@ -405,6 +405,28 @@ int of_irq_get(struct device_node *dev, int index)
return irq_create_of_mapping(&oirq);
}
/**
* of_irq_get_byname - Decode a node's IRQ and return it as a Linux irq number
* @dev: pointer to device tree node
* @name: irq name
*
* Returns Linux irq number on success, or -EPROBE_DEFER if the irq domain
* is not yet created, or error code in case of any other failure.
*/
int of_irq_get_byname(struct device_node *dev, const char *name)
{
int index;
if (unlikely(!name))
return -EINVAL;
index = of_property_match_string(dev, "interrupt-names", name);
if (index < 0)
return index;
return of_irq_get(dev, index);
}
/**
* of_irq_count - Count the number of IRQs a node uses
* @dev: pointer to device tree node