diff options
author | Rob Herring <robh@kernel.org> | 2021-10-06 11:43:28 -0500 |
---|---|---|
committer | Rob Herring <robh@kernel.org> | 2021-10-20 13:37:24 -0500 |
commit | bd2259ee458e299ec14061da7faddcfb0d54d154 (patch) | |
tree | 25eeec24a19810677b4aade39ef16567e97ea60b /arch | |
parent | 41408b22ec38d445de7f374d3cc01a316e1d14fc (diff) |
riscv: Use of_get_cpu_hwid()
Replace open coded parsing of CPU nodes' 'reg' property with
of_get_cpu_hwid().
Cc: Paul Walmsley <paul.walmsley@sifive.com>
Cc: Palmer Dabbelt <palmer@dabbelt.com>
Cc: Albert Ou <aou@eecs.berkeley.edu>
Cc: linux-riscv@lists.infradead.org
Signed-off-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20211006164332.1981454-9-robh@kernel.org
Diffstat (limited to 'arch')
-rw-r--r-- | arch/riscv/kernel/cpu.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/riscv/kernel/cpu.c b/arch/riscv/kernel/cpu.c index 6d59e6906fdd..f13b2c9ea912 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; } |