diff options
author | Grant Likely <grant.likely@secretlab.ca> | 2012-06-15 13:50:25 -0400 |
---|---|---|
committer | Rob Herring <rob.herring@calxeda.com> | 2012-07-06 08:16:34 -0400 |
commit | 74a7f08448adea6cb47cd9b260c98ff168117e92 (patch) | |
tree | df2ce1ae517e390d1049e01c1428a4b31fd689cc /arch/microblaze/pci | |
parent | 1af4c7f18a442771d86d496c761e9816349f98c9 (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>
Signed-off-by: Rob Herring <rob.herring@calxeda.com>
Diffstat (limited to 'arch/microblaze/pci')
-rw-r--r-- | arch/microblaze/pci/pci-common.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/arch/microblaze/pci/pci-common.c b/arch/microblaze/pci/pci-common.c index ed22bfc5db14..ca8f6e769960 100644 --- a/arch/microblaze/pci/pci-common.c +++ b/arch/microblaze/pci/pci-common.c | |||
@@ -249,8 +249,7 @@ int pci_read_irq_line(struct pci_dev *pci_dev) | |||
249 | } else { | 249 | } else { |
250 | pr_debug(" Got one, spec %d cells (0x%08x 0x%08x...) on %s\n", | 250 | pr_debug(" Got one, spec %d cells (0x%08x 0x%08x...) on %s\n", |
251 | oirq.size, oirq.specifier[0], oirq.specifier[1], | 251 | oirq.size, oirq.specifier[0], oirq.specifier[1], |
252 | oirq.controller ? oirq.controller->full_name : | 252 | of_node_full_name(oirq.controller)); |
253 | "<default>"); | ||
254 | 253 | ||
255 | virq = irq_create_of_mapping(oirq.controller, oirq.specifier, | 254 | virq = irq_create_of_mapping(oirq.controller, oirq.specifier, |
256 | oirq.size); | 255 | oirq.size); |
@@ -1493,8 +1492,7 @@ static void __devinit pcibios_scan_phb(struct pci_controller *hose) | |||
1493 | struct pci_bus *bus; | 1492 | struct pci_bus *bus; |
1494 | struct device_node *node = hose->dn; | 1493 | struct device_node *node = hose->dn; |
1495 | 1494 | ||
1496 | pr_debug("PCI: Scanning PHB %s\n", | 1495 | pr_debug("PCI: Scanning PHB %s\n", of_node_full_name(node)); |
1497 | node ? node->full_name : "<NO NAME>"); | ||
1498 | 1496 | ||
1499 | pcibios_setup_phb_resources(hose, &resources); | 1497 | pcibios_setup_phb_resources(hose, &resources); |
1500 | 1498 | ||