} else {
                pr_debug(" Got one, spec %d cells (0x%08x 0x%08x...) on %s\n",
                         oirq.size, oirq.specifier[0], oirq.specifier[1],
-                        oirq.controller ? oirq.controller->full_name :
-                        "<default>");
+                        of_node_full_name(oirq.controller));
 
                virq = irq_create_of_mapping(oirq.controller, oirq.specifier,
                                             oirq.size);
        struct pci_bus *bus;
        struct device_node *node = hose->dn;
 
-       pr_debug("PCI: Scanning PHB %s\n",
-                node ? node->full_name : "<NO NAME>");
+       pr_debug("PCI: Scanning PHB %s\n", of_node_full_name(node));
 
        pcibios_setup_phb_resources(hose, &resources);
 
 
        } else {
                pr_debug(" Got one, spec %d cells (0x%08x 0x%08x...) on %s\n",
                         oirq.size, oirq.specifier[0], oirq.specifier[1],
-                        oirq.controller ? oirq.controller->full_name :
-                        "<default>");
+                        of_node_full_name(oirq.controller));
 
                virq = irq_create_of_mapping(oirq.controller, oirq.specifier,
                                             oirq.size);
        struct device_node *node = hose->dn;
        int mode;
 
-       pr_debug("PCI: Scanning PHB %s\n",
-                node ? node->full_name : "<NO NAME>");
+       pr_debug("PCI: Scanning PHB %s\n", of_node_full_name(node));
 
        /* Get some IO space for the new PHB */
        pcibios_setup_phb_io_space(hose);
 
        struct iommu_table *tbl = get_iommu_table_base(dev);
 
        if (tbl)
-               iommu_free_table(tbl, dev->of_node ?
-                       dev->of_node->full_name : dev_name(dev));
+               iommu_free_table(tbl, of_node_full_name(dev->of_node));
        of_node_put(dev->of_node);
        kfree(to_vio_dev(dev));
 }
 {
        struct device_node *of_node = dev->of_node;
 
-       return sprintf(buf, "%s\n", of_node ? of_node->full_name : "none");
+       return sprintf(buf, "%s\n", of_node_full_name(of_node));
 }
 
 static ssize_t modalias_show(struct device *dev, struct device_attribute *attr,
 
        iommu = cell_iommu_for_node(dev_to_node(dev));
        if (iommu == NULL || list_empty(&iommu->windows)) {
                printk(KERN_ERR "iommu: missing iommu for %s (node %d)\n",
-                      dev->of_node ? dev->of_node->full_name : "?",
-                      dev_to_node(dev));
+                      of_node_full_name(dev->of_node), dev_to_node(dev));
                return NULL;
        }
        window = list_entry(iommu->windows.next, struct iommu_window, list);
 
        if (!pdn || !PCI_DN(pdn)) {
                printk(KERN_WARNING "pci_dma_dev_setup_pSeriesLP: "
                       "no DMA window found for pci dev=%s dn=%s\n",
-                                pci_name(dev), dn? dn->full_name : "<null>");
+                                pci_name(dev), of_node_full_name(dn));
                return;
        }
        pr_debug("  parent is %s\n", pdn->full_name);
 
                                printk("%s: Apply [%s:%x] imap --> [%s:%x]\n",
                                       op->dev.of_node->full_name,
                                       pp->full_name, this_orig_irq,
-                                      (iret ? iret->full_name : "NULL"), irq);
+                                      of_node_full_name(iret), irq);
 
                        if (!iret)
                                break;
 
        ap->stem[stem_len] = 0;
        list_add_tail(&ap->link, &aliases_lookup);
        pr_debug("adding DT alias:%s: stem=%s id=%i node=%s\n",
-                ap->alias, ap->stem, ap->id, np ? np->full_name : NULL);
+                ap->alias, ap->stem, ap->id, of_node_full_name(np));
 }
 
 /**
 
 
        skiplevel:
                /* Iterate again with new parent */
-               pr_debug(" -> new parent: %s\n", newpar ? newpar->full_name : "<>");
+               pr_debug(" -> new parent: %s\n", of_node_full_name(newpar));
                of_node_put(ipar);
                ipar = newpar;
                newpar = NULL;
 
 #define of_node_to_nid of_node_to_nid
 #endif
 
+static inline const char* of_node_full_name(struct device_node *np)
+{
+       return np ? np->full_name : "<no-node>";
+}
+
 extern struct device_node *of_find_node_by_name(struct device_node *from,
        const char *name);
 #define for_each_node_by_name(dn, name) \
 
 #else /* CONFIG_OF */
 
+static inline const char* of_node_full_name(struct device_node *np)
+{
+       return "<no-node>";
+}
+
 static inline bool of_have_populated_dt(void)
 {
        return false;
 
        }
 
        pr_debug("irq %lu on domain %s mapped to virtual irq %u\n",
-               hwirq, domain->of_node ? domain->of_node->full_name : "null", virq);
+               hwirq, of_node_full_name(domain->of_node), virq);
 
        return virq;
 }
                        return intspec[0];
 #endif
                pr_warning("no irq domain found for %s !\n",
-                          controller->full_name);
+                          of_node_full_name(controller));
                return 0;
        }
 
                        data = irq_desc_get_chip_data(desc);
                        seq_printf(m, data ? "0x%p  " : "  %p  ", data);
 
-                       if (desc->irq_data.domain && desc->irq_data.domain->of_node)
-                               p = desc->irq_data.domain->of_node->full_name;
+                       if (desc->irq_data.domain)
+                               p = of_node_full_name(desc->irq_data.domain->of_node);
                        else
                                p = none;
                        seq_printf(m, "%s\n", p);