mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-05 06:18:45 -04:00
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
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user