aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Herring <[email protected]>2021-10-06 11:43:27 -0500
committerRob Herring <[email protected]>2021-10-20 13:37:24 -0500
commit41408b22ec38d445de7f374d3cc01a316e1d14fc (patch)
tree32ca321d79068831d9b674113bb37b8493c366ea
parent4e0fa9eeb102165c38c51b68191ebfd84ccc5e04 (diff)
powerpc: Use of_get_cpu_hwid()
Replace open coded parsing of CPU nodes' 'reg' property with of_get_cpu_hwid(). Cc: Michael Ellerman <[email protected]> Cc: Benjamin Herrenschmidt <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: [email protected] Signed-off-by: Rob Herring <[email protected]> Acked-by: Michael Ellerman <[email protected]> Link: https://lore.kernel.org/r/[email protected]
-rw-r--r--arch/powerpc/kernel/smp.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c
index 9cc7d3dbf439..d96b0e361a73 100644
--- a/arch/powerpc/kernel/smp.c
+++ b/arch/powerpc/kernel/smp.c
@@ -1313,18 +1313,13 @@ int __cpu_up(unsigned int cpu, struct task_struct *tidle)
int cpu_to_core_id(int cpu)
{
struct device_node *np;
- const __be32 *reg;
int id = -1;
np = of_get_cpu_node(cpu, NULL);
if (!np)
goto out;
- reg = of_get_property(np, "reg", NULL);
- if (!reg)
- goto out;
-
- id = be32_to_cpup(reg);
+ id = of_get_cpu_hwid(np, 0);
out:
of_node_put(np);
return id;