Skip to content

Commit bc1cf75

Browse files
robherringmpe
authored andcommitted
powerpc: powermac: Use of_get_cpu_hwid() to read CPU node 'reg'
Replace open coded reading of CPU nodes' "reg" properties with of_get_cpu_hwid() dedicated for this purpose. Signed-off-by: Rob Herring <[email protected]> Signed-off-by: Michael Ellerman <[email protected]> Link: https://msgid.link/[email protected]
1 parent b751ed0 commit bc1cf75

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

arch/powerpc/platforms/powermac/feature.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1053,11 +1053,11 @@ core99_reset_cpu(struct device_node *node, long param, long value)
10531053
return -ENODEV;
10541054

10551055
for_each_of_cpu_node(np) {
1056-
const u32 *num = of_get_property(np, "reg", NULL);
10571056
const u32 *rst = of_get_property(np, "soft-reset", NULL);
1058-
if (num == NULL || rst == NULL)
1057+
if (!rst)
10591058
continue;
1060-
if (param == *num) {
1059+
if (param == of_get_cpu_hwid(np, 0)) {
1060+
of_node_put(np);
10611061
reset_io = *rst;
10621062
break;
10631063
}
@@ -1499,11 +1499,11 @@ static long g5_reset_cpu(struct device_node *node, long param, long value)
14991499
return -ENODEV;
15001500

15011501
for_each_of_cpu_node(np) {
1502-
const u32 *num = of_get_property(np, "reg", NULL);
15031502
const u32 *rst = of_get_property(np, "soft-reset", NULL);
1504-
if (num == NULL || rst == NULL)
1503+
if (!rst)
15051504
continue;
1506-
if (param == *num) {
1505+
if (param == of_get_cpu_hwid(np, 0)) {
1506+
of_node_put(np);
15071507
reset_io = *rst;
15081508
break;
15091509
}

0 commit comments

Comments
 (0)