[PATCH 5.10 286/332] riscv: Use of_get_cpu_hwid()
Greg Kroah-Hartman
gregkh at linuxfoundation.org
Mon Oct 27 11:35:39 PDT 2025
5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rob Herring <robh at kernel.org>
[ Upstream commit bd2259ee458e299ec14061da7faddcfb0d54d154 ]
Replace open coded parsing of CPU nodes' 'reg' property with
of_get_cpu_hwid().
Cc: Paul Walmsley <paul.walmsley at sifive.com>
Cc: Palmer Dabbelt <palmer at dabbelt.com>
Cc: Albert Ou <aou at eecs.berkeley.edu>
Cc: linux-riscv at lists.infradead.org
Signed-off-by: Rob Herring <robh at kernel.org>
Link: https://lore.kernel.org/r/20211006164332.1981454-9-robh@kernel.org
Stable-dep-of: d2721bb165b3 ("RISC-V: Don't print details of CPUs disabled in DT")
Signed-off-by: Sasha Levin <sashal at kernel.org>
---
arch/riscv/kernel/cpu.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/arch/riscv/kernel/cpu.c b/arch/riscv/kernel/cpu.c
index 6d59e6906fddf..f13b2c9ea912d 100644
--- a/arch/riscv/kernel/cpu.c
+++ b/arch/riscv/kernel/cpu.c
@@ -22,7 +22,8 @@ int riscv_of_processor_hartid(struct device_node *node)
return -ENODEV;
}
- if (of_property_read_u32(node, "reg", &hart)) {
+ hart = of_get_cpu_hwid(node, 0);
+ if (hart == ~0U) {
pr_warn("Found CPU without hart ID\n");
return -ENODEV;
}
--
2.51.0
More information about the linux-riscv
mailing list