Skip to content

Commit b7c670d

Browse files
robherringmpe
authored andcommitted
powerpc: 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 to remove storing of the full path string for each node. Signed-off-by: Rob Herring <robh@kernel.org> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Michael Ellerman <mpe@ellerman.id.au> Cc: Anatolij Gustschin <agust@denx.de> Cc: Scott Wood <oss@buserror.net> Cc: Kumar Gala <galak@kernel.crashing.org> Cc: Arnd Bergmann <arnd@arndb.de> Cc: linuxppc-dev@lists.ozlabs.org Reviewed-by: Tyrel Datwyler <tyreld@linux.vnet.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
1 parent bcf21e3 commit b7c670d

79 files changed

Lines changed: 461 additions & 487 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎arch/powerpc/kernel/btext.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ int __init btext_find_display(int allow_nonstdout)
253253

254254
for_each_node_by_type(np, "display") {
255255
if (of_get_property(np, "linux,opened", NULL)) {
256-
printk("trying %s ...\n", np->full_name);
256+
printk("trying %pOF ...\n", np);
257257
rc = btext_initialize(np);
258258
printk("result: %d\n", rc);
259259
}

‎arch/powerpc/kernel/cacheinfo.c‎

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -167,10 +167,10 @@ static void release_cache_debugcheck(struct cache *cache)
167167

168168
list_for_each_entry(iter, &cache_list, list)
169169
WARN_ONCE(iter->next_local == cache,
170-
"cache for %s(%s) refers to cache for %s(%s)\n",
171-
iter->ofnode->full_name,
170+
"cache for %pOF(%s) refers to cache for %pOF(%s)\n",
171+
iter->ofnode,
172172
cache_type_string(iter),
173-
cache->ofnode->full_name,
173+
cache->ofnode,
174174
cache_type_string(cache));
175175
}
176176

@@ -179,8 +179,8 @@ static void release_cache(struct cache *cache)
179179
if (!cache)
180180
return;
181181

182-
pr_debug("freeing L%d %s cache for %s\n", cache->level,
183-
cache_type_string(cache), cache->ofnode->full_name);
182+
pr_debug("freeing L%d %s cache for %pOF\n", cache->level,
183+
cache_type_string(cache), cache->ofnode);
184184

185185
release_cache_debugcheck(cache);
186186
list_del(&cache->list);
@@ -194,8 +194,8 @@ static void cache_cpu_set(struct cache *cache, int cpu)
194194

195195
while (next) {
196196
WARN_ONCE(cpumask_test_cpu(cpu, &next->shared_cpu_map),
197-
"CPU %i already accounted in %s(%s)\n",
198-
cpu, next->ofnode->full_name,
197+
"CPU %i already accounted in %pOF(%s)\n",
198+
cpu, next->ofnode,
199199
cache_type_string(next));
200200
cpumask_set_cpu(cpu, &next->shared_cpu_map);
201201
next = next->next_local;
@@ -355,7 +355,7 @@ static int cache_is_unified_d(const struct device_node *np)
355355
*/
356356
static struct cache *cache_do_one_devnode_unified(struct device_node *node, int level)
357357
{
358-
pr_debug("creating L%d ucache for %s\n", level, node->full_name);
358+
pr_debug("creating L%d ucache for %pOF\n", level, node);
359359

360360
return new_cache(cache_is_unified_d(node), level, node);
361361
}
@@ -365,8 +365,8 @@ static struct cache *cache_do_one_devnode_split(struct device_node *node,
365365
{
366366
struct cache *dcache, *icache;
367367

368-
pr_debug("creating L%d dcache and icache for %s\n", level,
369-
node->full_name);
368+
pr_debug("creating L%d dcache and icache for %pOF\n", level,
369+
node);
370370

371371
dcache = new_cache(CACHE_TYPE_DATA, level, node);
372372
icache = new_cache(CACHE_TYPE_INSTRUCTION, level, node);
@@ -679,7 +679,6 @@ static struct kobj_type cache_index_type = {
679679

680680
static void cacheinfo_create_index_opt_attrs(struct cache_index_dir *dir)
681681
{
682-
const char *cache_name;
683682
const char *cache_type;
684683
struct cache *cache;
685684
char *buf;
@@ -690,7 +689,6 @@ static void cacheinfo_create_index_opt_attrs(struct cache_index_dir *dir)
690689
return;
691690

692691
cache = dir->cache;
693-
cache_name = cache->ofnode->full_name;
694692
cache_type = cache_type_string(cache);
695693

696694
/* We don't want to create an attribute that can't provide a
@@ -707,14 +705,14 @@ static void cacheinfo_create_index_opt_attrs(struct cache_index_dir *dir)
707705
rc = attr->show(&dir->kobj, attr, buf);
708706
if (rc <= 0) {
709707
pr_debug("not creating %s attribute for "
710-
"%s(%s) (rc = %zd)\n",
711-
attr->attr.name, cache_name,
708+
"%pOF(%s) (rc = %zd)\n",
709+
attr->attr.name, cache->ofnode,
712710
cache_type, rc);
713711
continue;
714712
}
715713
if (sysfs_create_file(&dir->kobj, &attr->attr))
716-
pr_debug("could not create %s attribute for %s(%s)\n",
717-
attr->attr.name, cache_name, cache_type);
714+
pr_debug("could not create %s attribute for %pOF(%s)\n",
715+
attr->attr.name, cache->ofnode, cache_type);
718716
}
719717

720718
kfree(buf);
@@ -831,8 +829,8 @@ static void cache_cpu_clear(struct cache *cache, int cpu)
831829
struct cache *next = cache->next_local;
832830

833831
WARN_ONCE(!cpumask_test_cpu(cpu, &cache->shared_cpu_map),
834-
"CPU %i not accounted in %s(%s)\n",
835-
cpu, cache->ofnode->full_name,
832+
"CPU %i not accounted in %pOF(%s)\n",
833+
cpu, cache->ofnode,
836834
cache_type_string(cache));
837835

838836
cpumask_clear_cpu(cpu, &cache->shared_cpu_map);

‎arch/powerpc/kernel/io-workarounds.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ void iowa_register_bus(struct pci_controller *phb, struct ppc_pci_io *ops,
193193

194194
if (iowa_bus_count >= IOWA_MAX_BUS) {
195195
pr_err("IOWA:Too many pci bridges, "
196-
"workarounds disabled for %s\n", np->full_name);
196+
"workarounds disabled for %pOF\n", np);
197197
return;
198198
}
199199

@@ -208,6 +208,6 @@ void iowa_register_bus(struct pci_controller *phb, struct ppc_pci_io *ops,
208208

209209
iowa_bus_count++;
210210

211-
pr_debug("IOWA:[%d]Add bus, %s.\n", iowa_bus_count-1, np->full_name);
211+
pr_debug("IOWA:[%d]Add bus, %pOF.\n", iowa_bus_count-1, np);
212212
}
213213

‎arch/powerpc/kernel/isa-bridge.c‎

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ void __init isa_bridge_find_early(struct pci_controller *hose)
164164
/* Set the global ISA io base to indicate we have an ISA bridge */
165165
isa_io_base = ISA_IO_BASE;
166166

167-
pr_debug("ISA bridge (early) is %s\n", np->full_name);
167+
pr_debug("ISA bridge (early) is %pOF\n", np);
168168
}
169169

170170
/**
@@ -187,24 +187,24 @@ void __init isa_bridge_init_non_pci(struct device_node *np)
187187
pna = of_n_addr_cells(np);
188188
if (of_property_read_u32(np, "#address-cells", &na) ||
189189
of_property_read_u32(np, "#size-cells", &ns)) {
190-
pr_warn("ISA: Non-PCI bridge %s is missing address format\n",
191-
np->full_name);
190+
pr_warn("ISA: Non-PCI bridge %pOF is missing address format\n",
191+
np);
192192
return;
193193
}
194194

195195
/* Check it's a supported address format */
196196
if (na != 2 || ns != 1) {
197-
pr_warn("ISA: Non-PCI bridge %s has unsupported address format\n",
198-
np->full_name);
197+
pr_warn("ISA: Non-PCI bridge %pOF has unsupported address format\n",
198+
np);
199199
return;
200200
}
201201
rs = na + ns + pna;
202202

203203
/* Grab the ranges property */
204204
ranges = of_get_property(np, "ranges", &rlen);
205205
if (ranges == NULL || rlen < rs) {
206-
pr_warn("ISA: Non-PCI bridge %s has absent or invalid ranges\n",
207-
np->full_name);
206+
pr_warn("ISA: Non-PCI bridge %pOF has absent or invalid ranges\n",
207+
np);
208208
return;
209209
}
210210

@@ -220,8 +220,8 @@ void __init isa_bridge_init_non_pci(struct device_node *np)
220220

221221
/* Got something ? */
222222
if (!size || !pbasep) {
223-
pr_warn("ISA: Non-PCI bridge %s has no usable IO range\n",
224-
np->full_name);
223+
pr_warn("ISA: Non-PCI bridge %pOF has no usable IO range\n",
224+
np);
225225
return;
226226
}
227227

@@ -233,15 +233,15 @@ void __init isa_bridge_init_non_pci(struct device_node *np)
233233
/* Map pbase */
234234
pbase = of_translate_address(np, pbasep);
235235
if (pbase == OF_BAD_ADDR) {
236-
pr_warn("ISA: Non-PCI bridge %s failed to translate IO base\n",
237-
np->full_name);
236+
pr_warn("ISA: Non-PCI bridge %pOF failed to translate IO base\n",
237+
np);
238238
return;
239239
}
240240

241241
/* We need page alignment */
242242
if ((cbase & ~PAGE_MASK) || (pbase & ~PAGE_MASK)) {
243-
pr_warn("ISA: Non-PCI bridge %s has non aligned IO range\n",
244-
np->full_name);
243+
pr_warn("ISA: Non-PCI bridge %pOF has non aligned IO range\n",
244+
np);
245245
return;
246246
}
247247

@@ -255,7 +255,7 @@ void __init isa_bridge_init_non_pci(struct device_node *np)
255255
__ioremap_at(pbase, (void *)ISA_IO_BASE,
256256
size, pgprot_val(pgprot_noncached(__pgprot(0))));
257257

258-
pr_debug("ISA: Non-PCI bridge is %s\n", np->full_name);
258+
pr_debug("ISA: Non-PCI bridge is %pOF\n", np);
259259
}
260260

261261
/**
@@ -277,8 +277,8 @@ static void isa_bridge_find_late(struct pci_dev *pdev,
277277
/* Set the global ISA io base to indicate we have an ISA bridge */
278278
isa_io_base = ISA_IO_BASE;
279279

280-
pr_debug("ISA bridge (late) is %s on %s\n",
281-
devnode->full_name, pci_name(pdev));
280+
pr_debug("ISA bridge (late) is %pOF on %s\n",
281+
devnode, pci_name(pdev));
282282
}
283283

284284
/**

‎arch/powerpc/kernel/legacy_serial.c‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,8 @@ static int __init add_legacy_port(struct device_node *np, int want_index,
147147
legacy_serial_ports[index].serial_out = tsi_serial_out;
148148
}
149149

150-
printk(KERN_DEBUG "Found legacy serial port %d for %s\n",
151-
index, np->full_name);
150+
printk(KERN_DEBUG "Found legacy serial port %d for %pOF\n",
151+
index, np);
152152
printk(KERN_DEBUG " %s=%llx, taddr=%llx, irq=%lx, clk=%d, speed=%d\n",
153153
(iotype == UPIO_PORT) ? "port" : "mem",
154154
(unsigned long long)base, (unsigned long long)taddr, irq,
@@ -207,7 +207,7 @@ static int __init add_legacy_isa_port(struct device_node *np,
207207
int index = -1;
208208
u64 taddr;
209209

210-
DBG(" -> add_legacy_isa_port(%s)\n", np->full_name);
210+
DBG(" -> add_legacy_isa_port(%pOF)\n", np);
211211

212212
/* Get the ISA port number */
213213
reg = of_get_property(np, "reg", NULL);
@@ -256,7 +256,7 @@ static int __init add_legacy_pci_port(struct device_node *np,
256256
unsigned int flags;
257257
int iotype, index = -1, lindex = 0;
258258

259-
DBG(" -> add_legacy_pci_port(%s)\n", np->full_name);
259+
DBG(" -> add_legacy_pci_port(%pOF)\n", np);
260260

261261
/* We only support ports that have a clock frequency properly
262262
* encoded in the device-tree (that is have an fcode). Anything
@@ -374,7 +374,7 @@ void __init find_legacy_serial_ports(void)
374374
if (path != NULL) {
375375
stdout = of_find_node_by_path(path);
376376
if (stdout)
377-
DBG("stdout is %s\n", stdout->full_name);
377+
DBG("stdout is %pOF\n", stdout);
378378
} else {
379379
DBG(" no linux,stdout-path !\n");
380380
}
@@ -603,7 +603,7 @@ static int __init check_legacy_serial_console(void)
603603
DBG(" can't find stdout package %s !\n", name);
604604
return -ENODEV;
605605
}
606-
DBG("stdout is %s\n", prom_stdout->full_name);
606+
DBG("stdout is %pOF\n", prom_stdout);
607607

608608
name = of_get_property(prom_stdout, "name", NULL);
609609
if (!name) {

‎arch/powerpc/kernel/of_platform.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ static int of_pci_phb_probe(struct platform_device *dev)
4545
if (ppc_md.pci_setup_phb == NULL)
4646
return -ENODEV;
4747

48-
pr_info("Setting up PCI bus %s\n", dev->dev.of_node->full_name);
48+
pr_info("Setting up PCI bus %pOF\n", dev->dev.of_node);
4949

5050
/* Alloc and setup PHB data structure */
5151
phb = pcibios_alloc_controller(dev->dev.of_node);

‎arch/powerpc/kernel/pci-common.c‎

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -373,9 +373,8 @@ static int pci_read_irq_line(struct pci_dev *pci_dev)
373373
if (virq)
374374
irq_set_irq_type(virq, IRQ_TYPE_LEVEL_LOW);
375375
} else {
376-
pr_debug(" Got one, spec %d cells (0x%08x 0x%08x...) on %s\n",
377-
oirq.args_count, oirq.args[0], oirq.args[1],
378-
of_node_full_name(oirq.np));
376+
pr_debug(" Got one, spec %d cells (0x%08x 0x%08x...) on %pOF\n",
377+
oirq.args_count, oirq.args[0], oirq.args[1], oirq.np);
379378

380379
virq = irq_create_of_mapping(&oirq);
381380
}
@@ -741,8 +740,8 @@ void pci_process_bridge_OF_ranges(struct pci_controller *hose,
741740
struct of_pci_range range;
742741
struct of_pci_range_parser parser;
743742

744-
printk(KERN_INFO "PCI host bridge %s %s ranges:\n",
745-
dev->full_name, primary ? "(primary)" : "");
743+
printk(KERN_INFO "PCI host bridge %pOF %s ranges:\n",
744+
dev, primary ? "(primary)" : "");
746745

747746
/* Check for ranges property */
748747
if (of_pci_range_parser_init(&parser, dev))
@@ -1556,8 +1555,8 @@ static void pcibios_setup_phb_resources(struct pci_controller *hose,
15561555

15571556
if (!res->flags) {
15581557
pr_debug("PCI: I/O resource not set for host"
1559-
" bridge %s (domain %d)\n",
1560-
hose->dn->full_name, hose->global_number);
1558+
" bridge %pOF (domain %d)\n",
1559+
hose->dn, hose->global_number);
15611560
} else {
15621561
offset = pcibios_io_space_offset(hose);
15631562

@@ -1668,7 +1667,7 @@ void pcibios_scan_phb(struct pci_controller *hose)
16681667
struct device_node *node = hose->dn;
16691668
int mode;
16701669

1671-
pr_debug("PCI: Scanning PHB %s\n", of_node_full_name(node));
1670+
pr_debug("PCI: Scanning PHB %pOF\n", node);
16721671

16731672
/* Get some IO space for the new PHB */
16741673
pcibios_setup_phb_io_space(hose);

‎arch/powerpc/kernel/pci_32.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ make_one_node_map(struct device_node* node, u8 pci_bus)
7979
return;
8080
bus_range = of_get_property(node, "bus-range", &len);
8181
if (bus_range == NULL || len < 2 * sizeof(int)) {
82-
printk(KERN_WARNING "Can't get bus-range for %s, "
83-
"assuming it starts at 0\n", node->full_name);
82+
printk(KERN_WARNING "Can't get bus-range for %pOF, "
83+
"assuming it starts at 0\n", node);
8484
pci_to_OF_bus_map[pci_bus] = 0;
8585
} else
8686
pci_to_OF_bus_map[pci_bus] = bus_range[0];

‎arch/powerpc/kernel/pci_64.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ int pcibios_unmap_io_space(struct pci_bus *bus)
111111
if (hose->io_base_alloc == NULL)
112112
return 0;
113113

114-
pr_debug("IO unmapping for PHB %s\n", hose->dn->full_name);
114+
pr_debug("IO unmapping for PHB %pOF\n", hose->dn);
115115
pr_debug(" alloc=0x%p\n", hose->io_base_alloc);
116116

117117
/* This is a PHB, we fully unmap the IO area */
@@ -151,7 +151,7 @@ static int pcibios_map_phb_io_space(struct pci_controller *hose)
151151
hose->io_base_virt = (void __iomem *)(area->addr +
152152
hose->io_base_phys - phys_page);
153153

154-
pr_debug("IO mapping for PHB %s\n", hose->dn->full_name);
154+
pr_debug("IO mapping for PHB %pOF\n", hose->dn);
155155
pr_debug(" phys=0x%016llx, virt=0x%p (alloc=0x%p)\n",
156156
hose->io_base_phys, hose->io_base_virt, hose->io_base_alloc);
157157
pr_debug(" size=0x%016llx (alloc=0x%016lx)\n",

0 commit comments

Comments
 (0)