diff options
author | Johan Hovold <johan@kernel.org> | 2019-01-18 17:03:08 +0300 |
---|---|---|
committer | Palmer Dabbelt <palmer@sifive.com> | 2019-02-12 02:35:52 +0300 |
commit | dd81c8ab819d360c92703564d0a8d0b9d4688267 (patch) | |
tree | 4d5eaae0898169bcf6ad4bf577988b810f3683b1 /arch/riscv/kernel/smpboot.c | |
parent | e3d794d555cda31d48c89bdbc96ce862857be93f (diff) | |
download | linux-dd81c8ab819d360c92703564d0a8d0b9d4688267.tar.xz |
riscv: use for_each_of_cpu_node iterator
Use the new for_each_of_cpu_node() helper to iterate over cpu nodes
instead of open coding. Note that this will allow matching also on the
node name instead of the (for FDT) deprecated device_type property.
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
Diffstat (limited to 'arch/riscv/kernel/smpboot.c')
-rw-r--r-- | arch/riscv/kernel/smpboot.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/riscv/kernel/smpboot.c b/arch/riscv/kernel/smpboot.c index 18cda0e8cf94..6e2813257e03 100644 --- a/arch/riscv/kernel/smpboot.c +++ b/arch/riscv/kernel/smpboot.c @@ -50,12 +50,12 @@ void __init smp_prepare_cpus(unsigned int max_cpus) void __init setup_smp(void) { - struct device_node *dn = NULL; + struct device_node *dn; int hart; bool found_boot_cpu = false; int cpuid = 1; - while ((dn = of_find_node_by_type(dn, "cpu"))) { + for_each_of_cpu_node(dn) { hart = riscv_of_processor_hartid(dn); if (hart < 0) continue; |