Skip to content

Commit 0b54967

Browse files
committed
fixup! arch/arm64: Add Revision, Serial, Model to cpuinfo
1 parent 33c90d7 commit 0b54967

File tree

1 file changed

+22
-22
lines changed

1 file changed

+22
-22
lines changed

arch/arm64/kernel/cpuinfo.c

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -219,10 +219,6 @@ static int c_show(struct seq_file *m, void *v)
219219
bool compat = personality(current->personality) == PER_LINUX32;
220220
struct cpuinfo_arm64 *cpuinfo = v;
221221
u32 midr = cpuinfo->reg_midr;
222-
struct device_node *np;
223-
const char *model;
224-
const char *serial;
225-
u32 revision;
226222

227223
/*
228224
* glibc reads /proc/cpuinfo to determine the number of
@@ -278,24 +274,6 @@ static int c_show(struct seq_file *m, void *v)
278274
seq_printf(m, "CPU part\t: 0x%03x\n", MIDR_PARTNUM(midr));
279275
seq_printf(m, "CPU revision\t: %d\n\n", MIDR_REVISION(midr));
280276

281-
np = of_find_node_by_path("/system");
282-
if (np) {
283-
if (!of_property_read_u32(np, "linux,revision", &revision))
284-
seq_printf(m, "Revision\t: %04x\n", revision);
285-
of_node_put(np);
286-
}
287-
288-
np = of_find_node_by_path("/");
289-
if (np) {
290-
if (!of_property_read_string(np, "serial-number",
291-
&serial))
292-
seq_printf(m, "Serial\t\t: %s\n", serial);
293-
if (!of_property_read_string(np, "model",
294-
&model))
295-
seq_printf(m, "Model\t\t: %s\n", model);
296-
of_node_put(np);
297-
}
298-
299277
return 0;
300278
}
301279

@@ -313,6 +291,28 @@ static void *c_next(struct seq_file *m, void *v, loff_t *pos)
313291

314292
static void c_stop(struct seq_file *m, void *v)
315293
{
294+
struct device_node *np;
295+
const char *model;
296+
const char *serial;
297+
u32 revision;
298+
299+
np = of_find_node_by_path("/system");
300+
if (np) {
301+
if (!of_property_read_u32(np, "linux,revision", &revision))
302+
seq_printf(m, "Revision\t: %04x\n", revision);
303+
of_node_put(np);
304+
}
305+
306+
np = of_find_node_by_path("/");
307+
if (np) {
308+
if (!of_property_read_string(np, "serial-number",
309+
&serial))
310+
seq_printf(m, "Serial\t\t: %s\n", serial);
311+
if (!of_property_read_string(np, "model",
312+
&model))
313+
seq_printf(m, "Model\t\t: %s\n", model);
314+
of_node_put(np);
315+
}
316316
}
317317

318318
const struct seq_operations cpuinfo_op = {

0 commit comments

Comments
 (0)