diff options
author | Grant Likely <grant.likely@secretlab.ca> | 2012-06-04 01:04:33 -0400 |
---|---|---|
committer | Grant Likely <grant.likely@secretlab.ca> | 2012-06-15 13:44:03 -0400 |
commit | efd68e7254503f3207805f674a1ea1d743f5dfe2 (patch) | |
tree | d5d0dc0b2b6fdf41ff57eb4b21501fbfe3a56d64 /kernel | |
parent | cfaf025112d3856637ff34a767ef785ef5cf2ca9 (diff) |
devicetree: add helper inline for retrieving a node's full name
The pattern (np ? np->full_name : "<none>") is rather common in the
kernel, but can also make for quite long lines. This patch adds a new
inline function, of_node_full_name() so that the test for a valid node
pointer doesn't need to be open coded at all call sites.
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Cc: Paul Mundt <lethal@linux-sh.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/irq/irqdomain.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c index 41c1564103f1..38c5eb839c92 100644 --- a/kernel/irq/irqdomain.c +++ b/kernel/irq/irqdomain.c | |||
@@ -448,7 +448,7 @@ unsigned int irq_create_mapping(struct irq_domain *domain, | |||
448 | } | 448 | } |
449 | 449 | ||
450 | pr_debug("irq %lu on domain %s mapped to virtual irq %u\n", | 450 | pr_debug("irq %lu on domain %s mapped to virtual irq %u\n", |
451 | hwirq, domain->of_node ? domain->of_node->full_name : "null", virq); | 451 | hwirq, of_node_full_name(domain->of_node), virq); |
452 | 452 | ||
453 | return virq; | 453 | return virq; |
454 | } | 454 | } |
@@ -477,7 +477,7 @@ unsigned int irq_create_of_mapping(struct device_node *controller, | |||
477 | return intspec[0]; | 477 | return intspec[0]; |
478 | #endif | 478 | #endif |
479 | pr_warning("no irq domain found for %s !\n", | 479 | pr_warning("no irq domain found for %s !\n", |
480 | controller->full_name); | 480 | of_node_full_name(controller)); |
481 | return 0; | 481 | return 0; |
482 | } | 482 | } |
483 | 483 | ||
@@ -725,8 +725,8 @@ static int virq_debug_show(struct seq_file *m, void *private) | |||
725 | data = irq_desc_get_chip_data(desc); | 725 | data = irq_desc_get_chip_data(desc); |
726 | seq_printf(m, data ? "0x%p " : " %p ", data); | 726 | seq_printf(m, data ? "0x%p " : " %p ", data); |
727 | 727 | ||
728 | if (desc->irq_data.domain && desc->irq_data.domain->of_node) | 728 | if (desc->irq_data.domain) |
729 | p = desc->irq_data.domain->of_node->full_name; | 729 | p = of_node_full_name(desc->irq_data.domain->of_node); |
730 | else | 730 | else |
731 | p = none; | 731 | p = none; |
732 | seq_printf(m, "%s\n", p); | 732 | seq_printf(m, "%s\n", p); |