mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 20:51:03 +02:00
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 <robh@kernel.org> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://msgid.link/20230319145931.65499-1-robh@kernel.org
This commit is contained in:
committed by
Michael Ellerman
parent
b751ed04bc
commit
bc1cf75027
@@ -1053,11 +1053,11 @@ core99_reset_cpu(struct device_node *node, long param, long value)
|
|||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|
||||||
for_each_of_cpu_node(np) {
|
for_each_of_cpu_node(np) {
|
||||||
const u32 *num = of_get_property(np, "reg", NULL);
|
|
||||||
const u32 *rst = of_get_property(np, "soft-reset", NULL);
|
const u32 *rst = of_get_property(np, "soft-reset", NULL);
|
||||||
if (num == NULL || rst == NULL)
|
if (!rst)
|
||||||
continue;
|
continue;
|
||||||
if (param == *num) {
|
if (param == of_get_cpu_hwid(np, 0)) {
|
||||||
|
of_node_put(np);
|
||||||
reset_io = *rst;
|
reset_io = *rst;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -1499,11 +1499,11 @@ static long g5_reset_cpu(struct device_node *node, long param, long value)
|
|||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|
||||||
for_each_of_cpu_node(np) {
|
for_each_of_cpu_node(np) {
|
||||||
const u32 *num = of_get_property(np, "reg", NULL);
|
|
||||||
const u32 *rst = of_get_property(np, "soft-reset", NULL);
|
const u32 *rst = of_get_property(np, "soft-reset", NULL);
|
||||||
if (num == NULL || rst == NULL)
|
if (!rst)
|
||||||
continue;
|
continue;
|
||||||
if (param == *num) {
|
if (param == of_get_cpu_hwid(np, 0)) {
|
||||||
|
of_node_put(np);
|
||||||
reset_io = *rst;
|
reset_io = *rst;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user