Skip to content

Commit a06ecbf

Browse files
committed
Revert "sparc: Convert to using %pOFn instead of device_node.name"
This reverts commit 0b9871a. Causes crashes with qemu, interacts badly with commit commit 6d0a70a ("vsprintf: print OF node name using full_name") etc. Reported-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent d1f1f98 commit a06ecbf

File tree

4 files changed

+51
-51
lines changed

4 files changed

+51
-51
lines changed

arch/sparc/kernel/auxio_64.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,8 @@ static int auxio_probe(struct platform_device *dev)
115115
auxio_devtype = AUXIO_TYPE_SBUS;
116116
size = 1;
117117
} else {
118-
printk("auxio: Unknown parent bus type [%pOFn]\n",
119-
dp->parent);
118+
printk("auxio: Unknown parent bus type [%s]\n",
119+
dp->parent->name);
120120
return -ENODEV;
121121
}
122122
auxio_register = of_ioremap(&dev->resource[0], 0, size, "auxio");

arch/sparc/kernel/power.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ static int power_probe(struct platform_device *op)
4141

4242
power_reg = of_ioremap(res, 0, 0x4, "power");
4343

44-
printk(KERN_INFO "%pOFn: Control reg at %llx\n",
45-
op->dev.of_node, res->start);
44+
printk(KERN_INFO "%s: Control reg at %llx\n",
45+
op->dev.of_node->name, res->start);
4646

4747
if (has_button_interrupt(irq, op->dev.of_node)) {
4848
if (request_irq(irq,

arch/sparc/kernel/prom_32.c

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ static void __init sparc32_path_component(struct device_node *dp, char *tmp_buf)
6868
return;
6969

7070
regs = rprop->value;
71-
sprintf(tmp_buf, "%pOFn@%x,%x",
72-
dp,
71+
sprintf(tmp_buf, "%s@%x,%x",
72+
dp->name,
7373
regs->which_io, regs->phys_addr);
7474
}
7575

@@ -84,8 +84,8 @@ static void __init sbus_path_component(struct device_node *dp, char *tmp_buf)
8484
return;
8585

8686
regs = prop->value;
87-
sprintf(tmp_buf, "%pOFn@%x,%x",
88-
dp,
87+
sprintf(tmp_buf, "%s@%x,%x",
88+
dp->name,
8989
regs->which_io,
9090
regs->phys_addr);
9191
}
@@ -104,13 +104,13 @@ static void __init pci_path_component(struct device_node *dp, char *tmp_buf)
104104
regs = prop->value;
105105
devfn = (regs->phys_hi >> 8) & 0xff;
106106
if (devfn & 0x07) {
107-
sprintf(tmp_buf, "%pOFn@%x,%x",
108-
dp,
107+
sprintf(tmp_buf, "%s@%x,%x",
108+
dp->name,
109109
devfn >> 3,
110110
devfn & 0x07);
111111
} else {
112-
sprintf(tmp_buf, "%pOFn@%x",
113-
dp,
112+
sprintf(tmp_buf, "%s@%x",
113+
dp->name,
114114
devfn >> 3);
115115
}
116116
}
@@ -127,8 +127,8 @@ static void __init ebus_path_component(struct device_node *dp, char *tmp_buf)
127127

128128
regs = prop->value;
129129

130-
sprintf(tmp_buf, "%pOFn@%x,%x",
131-
dp,
130+
sprintf(tmp_buf, "%s@%x,%x",
131+
dp->name,
132132
regs->which_io, regs->phys_addr);
133133
}
134134

@@ -167,8 +167,8 @@ static void __init ambapp_path_component(struct device_node *dp, char *tmp_buf)
167167
return;
168168
device = prop->value;
169169

170-
sprintf(tmp_buf, "%pOFn:%d:%d@%x,%x",
171-
dp, *vendor, *device,
170+
sprintf(tmp_buf, "%s:%d:%d@%x,%x",
171+
dp->name, *vendor, *device,
172172
*intr, reg0);
173173
}
174174

@@ -201,7 +201,7 @@ char * __init build_path_component(struct device_node *dp)
201201
tmp_buf[0] = '\0';
202202
__build_path_component(dp, tmp_buf);
203203
if (tmp_buf[0] == '\0')
204-
snprintf(tmp_buf, sizeof(tmp_buf), "%pOFn", dp);
204+
strcpy(tmp_buf, dp->name);
205205

206206
n = prom_early_alloc(strlen(tmp_buf) + 1);
207207
strcpy(n, tmp_buf);

arch/sparc/kernel/prom_64.c

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ static void __init sun4v_path_component(struct device_node *dp, char *tmp_buf)
8282

8383
regs = rprop->value;
8484
if (!of_node_is_root(dp->parent)) {
85-
sprintf(tmp_buf, "%pOFn@%x,%x",
86-
dp,
85+
sprintf(tmp_buf, "%s@%x,%x",
86+
dp->name,
8787
(unsigned int) (regs->phys_addr >> 32UL),
8888
(unsigned int) (regs->phys_addr & 0xffffffffUL));
8989
return;
@@ -97,17 +97,17 @@ static void __init sun4v_path_component(struct device_node *dp, char *tmp_buf)
9797
const char *prefix = (type == 0) ? "m" : "i";
9898

9999
if (low_bits)
100-
sprintf(tmp_buf, "%pOFn@%s%x,%x",
101-
dp, prefix,
100+
sprintf(tmp_buf, "%s@%s%x,%x",
101+
dp->name, prefix,
102102
high_bits, low_bits);
103103
else
104-
sprintf(tmp_buf, "%pOFn@%s%x",
105-
dp,
104+
sprintf(tmp_buf, "%s@%s%x",
105+
dp->name,
106106
prefix,
107107
high_bits);
108108
} else if (type == 12) {
109-
sprintf(tmp_buf, "%pOFn@%x",
110-
dp, high_bits);
109+
sprintf(tmp_buf, "%s@%x",
110+
dp->name, high_bits);
111111
}
112112
}
113113

@@ -122,8 +122,8 @@ static void __init sun4u_path_component(struct device_node *dp, char *tmp_buf)
122122

123123
regs = prop->value;
124124
if (!of_node_is_root(dp->parent)) {
125-
sprintf(tmp_buf, "%pOFn@%x,%x",
126-
dp,
125+
sprintf(tmp_buf, "%s@%x,%x",
126+
dp->name,
127127
(unsigned int) (regs->phys_addr >> 32UL),
128128
(unsigned int) (regs->phys_addr & 0xffffffffUL));
129129
return;
@@ -138,8 +138,8 @@ static void __init sun4u_path_component(struct device_node *dp, char *tmp_buf)
138138
if (tlb_type >= cheetah)
139139
mask = 0x7fffff;
140140

141-
sprintf(tmp_buf, "%pOFn@%x,%x",
142-
dp,
141+
sprintf(tmp_buf, "%s@%x,%x",
142+
dp->name,
143143
*(u32 *)prop->value,
144144
(unsigned int) (regs->phys_addr & mask));
145145
}
@@ -156,8 +156,8 @@ static void __init sbus_path_component(struct device_node *dp, char *tmp_buf)
156156
return;
157157

158158
regs = prop->value;
159-
sprintf(tmp_buf, "%pOFn@%x,%x",
160-
dp,
159+
sprintf(tmp_buf, "%s@%x,%x",
160+
dp->name,
161161
regs->which_io,
162162
regs->phys_addr);
163163
}
@@ -176,13 +176,13 @@ static void __init pci_path_component(struct device_node *dp, char *tmp_buf)
176176
regs = prop->value;
177177
devfn = (regs->phys_hi >> 8) & 0xff;
178178
if (devfn & 0x07) {
179-
sprintf(tmp_buf, "%pOFn@%x,%x",
180-
dp,
179+
sprintf(tmp_buf, "%s@%x,%x",
180+
dp->name,
181181
devfn >> 3,
182182
devfn & 0x07);
183183
} else {
184-
sprintf(tmp_buf, "%pOFn@%x",
185-
dp,
184+
sprintf(tmp_buf, "%s@%x",
185+
dp->name,
186186
devfn >> 3);
187187
}
188188
}
@@ -203,8 +203,8 @@ static void __init upa_path_component(struct device_node *dp, char *tmp_buf)
203203
if (!prop)
204204
return;
205205

206-
sprintf(tmp_buf, "%pOFn@%x,%x",
207-
dp,
206+
sprintf(tmp_buf, "%s@%x,%x",
207+
dp->name,
208208
*(u32 *) prop->value,
209209
(unsigned int) (regs->phys_addr & 0xffffffffUL));
210210
}
@@ -221,7 +221,7 @@ static void __init vdev_path_component(struct device_node *dp, char *tmp_buf)
221221

222222
regs = prop->value;
223223

224-
sprintf(tmp_buf, "%pOFn@%x", dp, *regs);
224+
sprintf(tmp_buf, "%s@%x", dp->name, *regs);
225225
}
226226

227227
/* "name@addrhi,addrlo" */
@@ -236,8 +236,8 @@ static void __init ebus_path_component(struct device_node *dp, char *tmp_buf)
236236

237237
regs = prop->value;
238238

239-
sprintf(tmp_buf, "%pOFn@%x,%x",
240-
dp,
239+
sprintf(tmp_buf, "%s@%x,%x",
240+
dp->name,
241241
(unsigned int) (regs->phys_addr >> 32UL),
242242
(unsigned int) (regs->phys_addr & 0xffffffffUL));
243243
}
@@ -257,8 +257,8 @@ static void __init i2c_path_component(struct device_node *dp, char *tmp_buf)
257257
/* This actually isn't right... should look at the #address-cells
258258
* property of the i2c bus node etc. etc.
259259
*/
260-
sprintf(tmp_buf, "%pOFn@%x,%x",
261-
dp, regs[0], regs[1]);
260+
sprintf(tmp_buf, "%s@%x,%x",
261+
dp->name, regs[0], regs[1]);
262262
}
263263

264264
/* "name@reg0[,reg1]" */
@@ -274,11 +274,11 @@ static void __init usb_path_component(struct device_node *dp, char *tmp_buf)
274274
regs = prop->value;
275275

276276
if (prop->length == sizeof(u32) || regs[1] == 1) {
277-
sprintf(tmp_buf, "%pOFn@%x",
278-
dp, regs[0]);
277+
sprintf(tmp_buf, "%s@%x",
278+
dp->name, regs[0]);
279279
} else {
280-
sprintf(tmp_buf, "%pOFn@%x,%x",
281-
dp, regs[0], regs[1]);
280+
sprintf(tmp_buf, "%s@%x,%x",
281+
dp->name, regs[0], regs[1]);
282282
}
283283
}
284284

@@ -295,11 +295,11 @@ static void __init ieee1394_path_component(struct device_node *dp, char *tmp_buf
295295
regs = prop->value;
296296

297297
if (regs[2] || regs[3]) {
298-
sprintf(tmp_buf, "%pOFn@%08x%08x,%04x%08x",
299-
dp, regs[0], regs[1], regs[2], regs[3]);
298+
sprintf(tmp_buf, "%s@%08x%08x,%04x%08x",
299+
dp->name, regs[0], regs[1], regs[2], regs[3]);
300300
} else {
301-
sprintf(tmp_buf, "%pOFn@%08x%08x",
302-
dp, regs[0], regs[1]);
301+
sprintf(tmp_buf, "%s@%08x%08x",
302+
dp->name, regs[0], regs[1]);
303303
}
304304
}
305305

@@ -361,7 +361,7 @@ char * __init build_path_component(struct device_node *dp)
361361
tmp_buf[0] = '\0';
362362
__build_path_component(dp, tmp_buf);
363363
if (tmp_buf[0] == '\0')
364-
snprintf(tmp_buf, sizeof(tmp_buf), "%pOFn", dp);
364+
strcpy(tmp_buf, dp->name);
365365

366366
n = prom_early_alloc(strlen(tmp_buf) + 1);
367367
strcpy(n, tmp_buf);

0 commit comments

Comments
 (0)