From: Rob Herring Date: Wed, 6 Oct 2021 16:43:27 +0000 (-0500) Subject: powerpc: Use of_get_cpu_hwid() X-Git-Tag: v5.16-rc1~135^2~26 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=41408b22ec38d445de7f374d3cc01a316e1d14fc;p=thirdparty%2Flinux.git powerpc: Use of_get_cpu_hwid() Replace open coded parsing of CPU nodes' 'reg' property with of_get_cpu_hwid(). Cc: Michael Ellerman Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: linuxppc-dev@lists.ozlabs.org Signed-off-by: Rob Herring Acked-by: Michael Ellerman Link: https://lore.kernel.org/r/20211006164332.1981454-8-robh@kernel.org --- diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c index 9cc7d3dbf4392..d96b0e361a735 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;