mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 10:41:38 -04:00
of/irq: Add interrupts-names property to name an irq resource
Add a interrupts-names property to allow the possibility to provide a name to any interrupts entries. If the name is available, use it to name the resource, otherwise keep the device full name. Signed-off-by: Benoit Cousson <[email protected]> Cc: Grant Likely <[email protected]> Cc: Rob Herring <[email protected]> [grant.likely: use "interrupt-names" and tidy documentation] Signed-off-by: Grant Likely <[email protected]>
This commit is contained in:
parent
35f3da32af
commit
661db794eb
2 changed files with 14 additions and 1 deletions
|
|
@ -341,9 +341,18 @@ int of_irq_to_resource(struct device_node *dev, int index, struct resource *r)
|
|||
/* Only dereference the resource if both the
|
||||
* resource and the irq are valid. */
|
||||
if (r && irq) {
|
||||
const char *name = NULL;
|
||||
|
||||
/*
|
||||
* Get optional "interrupts-names" property to add a name
|
||||
* to the resource.
|
||||
*/
|
||||
of_property_read_string_index(dev, "interrupt-names", index,
|
||||
&name);
|
||||
|
||||
r->start = r->end = irq;
|
||||
r->flags = IORESOURCE_IRQ;
|
||||
r->name = dev->full_name;
|
||||
r->name = name ? name : dev->full_name;
|
||||
}
|
||||
|
||||
return irq;
|
||||
|
|
|
|||
Loading…
Reference in a new issue