diff options
author | Rob Herring <robh@kernel.org> | 2017-07-18 17:43:21 -0400 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2017-08-24 12:24:59 -0400 |
commit | b63773a801ff7f7f047894a9be23616f4491aca8 (patch) | |
tree | 30480966a531698bdcc24d44ccb5f44680d998d7 | |
parent | 36b8518950f95837d2edc6c9ef8e0ef1fbcf04eb (diff) |
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>
-rw-r--r-- | drivers/pci/host/pci-mvebu.c | 8 | ||||
-rw-r--r-- | drivers/pci/host/pci-tegra.c | 3 | ||||
-rw-r--r-- | drivers/pci/hotplug/pnv_php.c | 4 | ||||
-rw-r--r-- | drivers/pci/hotplug/rpadlpar_core.c | 4 | ||||
-rw-r--r-- | drivers/pci/hotplug/rpaphp_core.c | 2 | ||||
-rw-r--r-- | drivers/pci/hotplug/rpaphp_pci.c | 4 | ||||
-rw-r--r-- | drivers/pci/hotplug/rpaphp_slot.c | 4 | ||||
-rw-r--r-- | drivers/pci/pci-sysfs.c | 4 | ||||
-rw-r--r-- | drivers/pci/pci.c | 4 |
9 files changed, 18 insertions, 19 deletions
diff --git a/drivers/pci/host/pci-mvebu.c b/drivers/pci/host/pci-mvebu.c index f353a6eb2f01..424982997eb9 100644 --- a/drivers/pci/host/pci-mvebu.c +++ b/drivers/pci/host/pci-mvebu.c | |||
@@ -1054,8 +1054,8 @@ static int mvebu_pcie_parse_port(struct mvebu_pcie *pcie, | |||
1054 | port->pcie = pcie; | 1054 | port->pcie = pcie; |
1055 | 1055 | ||
1056 | if (of_property_read_u32(child, "marvell,pcie-port", &port->port)) { | 1056 | if (of_property_read_u32(child, "marvell,pcie-port", &port->port)) { |
1057 | dev_warn(dev, "ignoring %s, missing pcie-port property\n", | 1057 | dev_warn(dev, "ignoring %pOF, missing pcie-port property\n", |
1058 | of_node_full_name(child)); | 1058 | child); |
1059 | goto skip; | 1059 | goto skip; |
1060 | } | 1060 | } |
1061 | 1061 | ||
@@ -1106,8 +1106,8 @@ static int mvebu_pcie_parse_port(struct mvebu_pcie *pcie, | |||
1106 | } | 1106 | } |
1107 | 1107 | ||
1108 | if (flags & OF_GPIO_ACTIVE_LOW) { | 1108 | if (flags & OF_GPIO_ACTIVE_LOW) { |
1109 | dev_info(dev, "%s: reset gpio is active low\n", | 1109 | dev_info(dev, "%pOF: reset gpio is active low\n", |
1110 | of_node_full_name(child)); | 1110 | child); |
1111 | gpio_flags = GPIOF_ACTIVE_LOW | | 1111 | gpio_flags = GPIOF_ACTIVE_LOW | |
1112 | GPIOF_OUT_INIT_LOW; | 1112 | GPIOF_OUT_INIT_LOW; |
1113 | } else { | 1113 | } else { |
diff --git a/drivers/pci/host/pci-tegra.c b/drivers/pci/host/pci-tegra.c index b3722b7709df..7eb9be5ae357 100644 --- a/drivers/pci/host/pci-tegra.c +++ b/drivers/pci/host/pci-tegra.c | |||
@@ -1703,8 +1703,7 @@ static int tegra_pcie_get_legacy_regulators(struct tegra_pcie *pcie) | |||
1703 | pcie->num_supplies = 2; | 1703 | pcie->num_supplies = 2; |
1704 | 1704 | ||
1705 | if (pcie->num_supplies == 0) { | 1705 | if (pcie->num_supplies == 0) { |
1706 | dev_err(dev, "device %s not supported in legacy mode\n", | 1706 | dev_err(dev, "device %pOF not supported in legacy mode\n", np); |
1707 | np->full_name); | ||
1708 | return -ENODEV; | 1707 | return -ENODEV; |
1709 | } | 1708 | } |
1710 | 1709 | ||
diff --git a/drivers/pci/hotplug/pnv_php.c b/drivers/pci/hotplug/pnv_php.c index 7c203198b582..74f6a17e4614 100644 --- a/drivers/pci/hotplug/pnv_php.c +++ b/drivers/pci/hotplug/pnv_php.c | |||
@@ -163,8 +163,8 @@ static void pnv_php_detach_device_nodes(struct device_node *parent) | |||
163 | of_node_put(dn); | 163 | of_node_put(dn); |
164 | refcount = kref_read(&dn->kobj.kref); | 164 | refcount = kref_read(&dn->kobj.kref); |
165 | if (refcount != 1) | 165 | if (refcount != 1) |
166 | pr_warn("Invalid refcount %d on <%s>\n", | 166 | pr_warn("Invalid refcount %d on <%pOF>\n", |
167 | refcount, of_node_full_name(dn)); | 167 | refcount, dn); |
168 | 168 | ||
169 | of_detach_node(dn); | 169 | of_detach_node(dn); |
170 | } | 170 | } |
diff --git a/drivers/pci/hotplug/rpadlpar_core.c b/drivers/pci/hotplug/rpadlpar_core.c index 3f93a4e79595..a3449d717a99 100644 --- a/drivers/pci/hotplug/rpadlpar_core.c +++ b/drivers/pci/hotplug/rpadlpar_core.c | |||
@@ -150,8 +150,8 @@ static void dlpar_pci_add_bus(struct device_node *dn) | |||
150 | /* Add EADS device to PHB bus, adding new entry to bus->devices */ | 150 | /* Add EADS device to PHB bus, adding new entry to bus->devices */ |
151 | dev = of_create_pci_dev(dn, phb->bus, pdn->devfn); | 151 | dev = of_create_pci_dev(dn, phb->bus, pdn->devfn); |
152 | if (!dev) { | 152 | if (!dev) { |
153 | printk(KERN_ERR "%s: failed to create pci dev for %s\n", | 153 | printk(KERN_ERR "%s: failed to create pci dev for %pOF\n", |
154 | __func__, dn->full_name); | 154 | __func__, dn); |
155 | return; | 155 | return; |
156 | } | 156 | } |
157 | 157 | ||
diff --git a/drivers/pci/hotplug/rpaphp_core.c b/drivers/pci/hotplug/rpaphp_core.c index 8d132024f06e..1e29abaaea08 100644 --- a/drivers/pci/hotplug/rpaphp_core.c +++ b/drivers/pci/hotplug/rpaphp_core.c | |||
@@ -318,7 +318,7 @@ int rpaphp_add_slot(struct device_node *dn) | |||
318 | if (!is_php_dn(dn, &indexes, &names, &types, &power_domains)) | 318 | if (!is_php_dn(dn, &indexes, &names, &types, &power_domains)) |
319 | return 0; | 319 | return 0; |
320 | 320 | ||
321 | dbg("Entry %s: dn->full_name=%s\n", __func__, dn->full_name); | 321 | dbg("Entry %s: dn=%pOF\n", __func__, dn); |
322 | 322 | ||
323 | /* register PCI devices */ | 323 | /* register PCI devices */ |
324 | name = (char *) &names[1]; | 324 | name = (char *) &names[1]; |
diff --git a/drivers/pci/hotplug/rpaphp_pci.c b/drivers/pci/hotplug/rpaphp_pci.c index ea41ea1d3c00..32aabc533be8 100644 --- a/drivers/pci/hotplug/rpaphp_pci.c +++ b/drivers/pci/hotplug/rpaphp_pci.c | |||
@@ -95,7 +95,7 @@ int rpaphp_enable_slot(struct slot *slot) | |||
95 | 95 | ||
96 | bus = pci_find_bus_by_node(slot->dn); | 96 | bus = pci_find_bus_by_node(slot->dn); |
97 | if (!bus) { | 97 | if (!bus) { |
98 | err("%s: no pci_bus for dn %s\n", __func__, slot->dn->full_name); | 98 | err("%s: no pci_bus for dn %pOF\n", __func__, slot->dn); |
99 | return -EINVAL; | 99 | return -EINVAL; |
100 | } | 100 | } |
101 | 101 | ||
@@ -125,7 +125,7 @@ int rpaphp_enable_slot(struct slot *slot) | |||
125 | 125 | ||
126 | if (rpaphp_debug) { | 126 | if (rpaphp_debug) { |
127 | struct pci_dev *dev; | 127 | struct pci_dev *dev; |
128 | dbg("%s: pci_devs of slot[%s]\n", __func__, slot->dn->full_name); | 128 | dbg("%s: pci_devs of slot[%pOF]\n", __func__, slot->dn); |
129 | list_for_each_entry(dev, &bus->devices, bus_list) | 129 | list_for_each_entry(dev, &bus->devices, bus_list) |
130 | dbg("\t%s\n", pci_name(dev)); | 130 | dbg("\t%s\n", pci_name(dev)); |
131 | } | 131 | } |
diff --git a/drivers/pci/hotplug/rpaphp_slot.c b/drivers/pci/hotplug/rpaphp_slot.c index 388c4d8fcdd1..489862360f2c 100644 --- a/drivers/pci/hotplug/rpaphp_slot.c +++ b/drivers/pci/hotplug/rpaphp_slot.c | |||
@@ -122,8 +122,8 @@ int rpaphp_register_slot(struct slot *slot) | |||
122 | int retval; | 122 | int retval; |
123 | int slotno = -1; | 123 | int slotno = -1; |
124 | 124 | ||
125 | dbg("%s registering slot:path[%s] index[%x], name[%s] pdomain[%x] type[%d]\n", | 125 | dbg("%s registering slot:path[%pOF] index[%x], name[%s] pdomain[%x] type[%d]\n", |
126 | __func__, slot->dn->full_name, slot->index, slot->name, | 126 | __func__, slot->dn, slot->index, slot->name, |
127 | slot->power_domain, slot->type); | 127 | slot->power_domain, slot->type); |
128 | 128 | ||
129 | /* should not try to register the same slot twice */ | 129 | /* should not try to register the same slot twice */ |
diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c index 93e7b97765d7..c9cdc8a1d48a 100644 --- a/drivers/pci/pci-sysfs.c +++ b/drivers/pci/pci-sysfs.c | |||
@@ -556,9 +556,9 @@ static ssize_t devspec_show(struct device *dev, | |||
556 | struct pci_dev *pdev = to_pci_dev(dev); | 556 | struct pci_dev *pdev = to_pci_dev(dev); |
557 | struct device_node *np = pci_device_to_OF_node(pdev); | 557 | struct device_node *np = pci_device_to_OF_node(pdev); |
558 | 558 | ||
559 | if (np == NULL || np->full_name == NULL) | 559 | if (np == NULL) |
560 | return 0; | 560 | return 0; |
561 | return sprintf(buf, "%s", np->full_name); | 561 | return sprintf(buf, "%pOF", np); |
562 | } | 562 | } |
563 | static DEVICE_ATTR_RO(devspec); | 563 | static DEVICE_ATTR_RO(devspec); |
564 | #endif | 564 | #endif |
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index af0cc3456dc1..e8e40dea2842 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c | |||
@@ -5363,8 +5363,8 @@ static int of_pci_bus_find_domain_nr(struct device *parent) | |||
5363 | use_dt_domains = 0; | 5363 | use_dt_domains = 0; |
5364 | domain = pci_get_new_domain_nr(); | 5364 | domain = pci_get_new_domain_nr(); |
5365 | } else { | 5365 | } else { |
5366 | dev_err(parent, "Node %s has inconsistent \"linux,pci-domain\" property in DT\n", | 5366 | dev_err(parent, "Node %pOF has inconsistent \"linux,pci-domain\" property in DT\n", |
5367 | parent->of_node->full_name); | 5367 | parent->of_node); |
5368 | domain = -1; | 5368 | domain = -1; |
5369 | } | 5369 | } |
5370 | 5370 | ||