PCI: Convert to using %pOF instead of full_name()
Now that we have a custom printf format specifier, convert users of full_name() to use %pOF instead. This is preparation for removing storing of the full path string for each node. Signed-off-by: Rob Herring <robh@kernel.org> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Reviewed-by: Tyrel Datwyler <tyreld@linux.vnet.ibm.com> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Cc: Jason Cooper <jason@lakedaemon.net> Cc: Thierry Reding <thierry.reding@gmail.com> Cc: Jonathan Hunter <jonathanh@nvidia.com> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Michael Ellerman <mpe@ellerman.id.au>
This commit is contained in:
committed by
Bjorn Helgaas
parent
36b8518950
commit
b63773a801
@@ -1054,8 +1054,8 @@ static int mvebu_pcie_parse_port(struct mvebu_pcie *pcie,
|
|||||||
port->pcie = pcie;
|
port->pcie = pcie;
|
||||||
|
|
||||||
if (of_property_read_u32(child, "marvell,pcie-port", &port->port)) {
|
if (of_property_read_u32(child, "marvell,pcie-port", &port->port)) {
|
||||||
dev_warn(dev, "ignoring %s, missing pcie-port property\n",
|
dev_warn(dev, "ignoring %pOF, missing pcie-port property\n",
|
||||||
of_node_full_name(child));
|
child);
|
||||||
goto skip;
|
goto skip;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1106,8 +1106,8 @@ static int mvebu_pcie_parse_port(struct mvebu_pcie *pcie,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (flags & OF_GPIO_ACTIVE_LOW) {
|
if (flags & OF_GPIO_ACTIVE_LOW) {
|
||||||
dev_info(dev, "%s: reset gpio is active low\n",
|
dev_info(dev, "%pOF: reset gpio is active low\n",
|
||||||
of_node_full_name(child));
|
child);
|
||||||
gpio_flags = GPIOF_ACTIVE_LOW |
|
gpio_flags = GPIOF_ACTIVE_LOW |
|
||||||
GPIOF_OUT_INIT_LOW;
|
GPIOF_OUT_INIT_LOW;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -1703,8 +1703,7 @@ static int tegra_pcie_get_legacy_regulators(struct tegra_pcie *pcie)
|
|||||||
pcie->num_supplies = 2;
|
pcie->num_supplies = 2;
|
||||||
|
|
||||||
if (pcie->num_supplies == 0) {
|
if (pcie->num_supplies == 0) {
|
||||||
dev_err(dev, "device %s not supported in legacy mode\n",
|
dev_err(dev, "device %pOF not supported in legacy mode\n", np);
|
||||||
np->full_name);
|
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -163,8 +163,8 @@ static void pnv_php_detach_device_nodes(struct device_node *parent)
|
|||||||
of_node_put(dn);
|
of_node_put(dn);
|
||||||
refcount = kref_read(&dn->kobj.kref);
|
refcount = kref_read(&dn->kobj.kref);
|
||||||
if (refcount != 1)
|
if (refcount != 1)
|
||||||
pr_warn("Invalid refcount %d on <%s>\n",
|
pr_warn("Invalid refcount %d on <%pOF>\n",
|
||||||
refcount, of_node_full_name(dn));
|
refcount, dn);
|
||||||
|
|
||||||
of_detach_node(dn);
|
of_detach_node(dn);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -150,8 +150,8 @@ static void dlpar_pci_add_bus(struct device_node *dn)
|
|||||||
/* Add EADS device to PHB bus, adding new entry to bus->devices */
|
/* Add EADS device to PHB bus, adding new entry to bus->devices */
|
||||||
dev = of_create_pci_dev(dn, phb->bus, pdn->devfn);
|
dev = of_create_pci_dev(dn, phb->bus, pdn->devfn);
|
||||||
if (!dev) {
|
if (!dev) {
|
||||||
printk(KERN_ERR "%s: failed to create pci dev for %s\n",
|
printk(KERN_ERR "%s: failed to create pci dev for %pOF\n",
|
||||||
__func__, dn->full_name);
|
__func__, dn);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -318,7 +318,7 @@ int rpaphp_add_slot(struct device_node *dn)
|
|||||||
if (!is_php_dn(dn, &indexes, &names, &types, &power_domains))
|
if (!is_php_dn(dn, &indexes, &names, &types, &power_domains))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
dbg("Entry %s: dn->full_name=%s\n", __func__, dn->full_name);
|
dbg("Entry %s: dn=%pOF\n", __func__, dn);
|
||||||
|
|
||||||
/* register PCI devices */
|
/* register PCI devices */
|
||||||
name = (char *) &names[1];
|
name = (char *) &names[1];
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ int rpaphp_enable_slot(struct slot *slot)
|
|||||||
|
|
||||||
bus = pci_find_bus_by_node(slot->dn);
|
bus = pci_find_bus_by_node(slot->dn);
|
||||||
if (!bus) {
|
if (!bus) {
|
||||||
err("%s: no pci_bus for dn %s\n", __func__, slot->dn->full_name);
|
err("%s: no pci_bus for dn %pOF\n", __func__, slot->dn);
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -125,7 +125,7 @@ int rpaphp_enable_slot(struct slot *slot)
|
|||||||
|
|
||||||
if (rpaphp_debug) {
|
if (rpaphp_debug) {
|
||||||
struct pci_dev *dev;
|
struct pci_dev *dev;
|
||||||
dbg("%s: pci_devs of slot[%s]\n", __func__, slot->dn->full_name);
|
dbg("%s: pci_devs of slot[%pOF]\n", __func__, slot->dn);
|
||||||
list_for_each_entry(dev, &bus->devices, bus_list)
|
list_for_each_entry(dev, &bus->devices, bus_list)
|
||||||
dbg("\t%s\n", pci_name(dev));
|
dbg("\t%s\n", pci_name(dev));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -122,8 +122,8 @@ int rpaphp_register_slot(struct slot *slot)
|
|||||||
int retval;
|
int retval;
|
||||||
int slotno = -1;
|
int slotno = -1;
|
||||||
|
|
||||||
dbg("%s registering slot:path[%s] index[%x], name[%s] pdomain[%x] type[%d]\n",
|
dbg("%s registering slot:path[%pOF] index[%x], name[%s] pdomain[%x] type[%d]\n",
|
||||||
__func__, slot->dn->full_name, slot->index, slot->name,
|
__func__, slot->dn, slot->index, slot->name,
|
||||||
slot->power_domain, slot->type);
|
slot->power_domain, slot->type);
|
||||||
|
|
||||||
/* should not try to register the same slot twice */
|
/* should not try to register the same slot twice */
|
||||||
|
|||||||
@@ -556,9 +556,9 @@ static ssize_t devspec_show(struct device *dev,
|
|||||||
struct pci_dev *pdev = to_pci_dev(dev);
|
struct pci_dev *pdev = to_pci_dev(dev);
|
||||||
struct device_node *np = pci_device_to_OF_node(pdev);
|
struct device_node *np = pci_device_to_OF_node(pdev);
|
||||||
|
|
||||||
if (np == NULL || np->full_name == NULL)
|
if (np == NULL)
|
||||||
return 0;
|
return 0;
|
||||||
return sprintf(buf, "%s", np->full_name);
|
return sprintf(buf, "%pOF", np);
|
||||||
}
|
}
|
||||||
static DEVICE_ATTR_RO(devspec);
|
static DEVICE_ATTR_RO(devspec);
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -5363,8 +5363,8 @@ static int of_pci_bus_find_domain_nr(struct device *parent)
|
|||||||
use_dt_domains = 0;
|
use_dt_domains = 0;
|
||||||
domain = pci_get_new_domain_nr();
|
domain = pci_get_new_domain_nr();
|
||||||
} else {
|
} else {
|
||||||
dev_err(parent, "Node %s has inconsistent \"linux,pci-domain\" property in DT\n",
|
dev_err(parent, "Node %pOF has inconsistent \"linux,pci-domain\" property in DT\n",
|
||||||
parent->of_node->full_name);
|
parent->of_node);
|
||||||
domain = -1;
|
domain = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user