ARM: shmobile: use for_each_of_cpu_node iterator
authorRob Herring <robh@kernel.org>
Mon, 27 Aug 2018 14:42:49 +0000 (09:42 -0500)
committerRob Herring <robh@kernel.org>
Fri, 28 Sep 2018 19:25:58 +0000 (14:25 -0500)
Use the for_each_of_cpu_node iterator to iterate over cpu nodes. This
has the side effect of defaulting to iterating using "cpu" node names in
preference to the deprecated (for FDT) device_type == "cpu".

Cc: Magnus Damm <magnus.damm@gmail.com>
Cc: Russell King <linux@armlinux.org.uk>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-renesas-soc@vger.kernel.org
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
Signed-off-by: Rob Herring <robh@kernel.org>
arch/arm/mach-shmobile/pm-rcar-gen2.c
arch/arm/mach-shmobile/pm-rmobile.c
arch/arm/mach-shmobile/timer.c

index 345af3ebcc3aeeb69fd79ff259f31f17cce007d0..7efe95bd584f07a6895a829702579868364d1a17 100644 (file)
@@ -50,7 +50,7 @@ void __init rcar_gen2_pm_init(void)
        void __iomem *p;
        u32 bar;
        static int once;
-       struct device_node *np, *cpus;
+       struct device_node *np;
        bool has_a7 = false;
        bool has_a15 = false;
        struct resource res;
@@ -59,11 +59,7 @@ void __init rcar_gen2_pm_init(void)
        if (once++)
                return;
 
-       cpus = of_find_node_by_path("/cpus");
-       if (!cpus)
-               return;
-
-       for_each_child_of_node(cpus, np) {
+       for_each_of_cpu_node(np) {
                if (of_device_is_compatible(np, "arm,cortex-a15"))
                        has_a15 = true;
                else if (of_device_is_compatible(np, "arm,cortex-a7"))
index e348bcfe389da51b96cbc2c0bddbbb93a9e7cf5c..94fdeef11b81c4b860982efc7631b5d79e82fd03 100644 (file)
@@ -202,7 +202,7 @@ static void __init get_special_pds(void)
        const struct of_device_id *id;
 
        /* PM domains containing CPUs */
-       for_each_node_by_type(np, "cpu")
+       for_each_of_cpu_node(np)
                add_special_pd(np, PD_CPU);
 
        /* PM domain containing console */
index 828e8aea037e7d5e8ba1483d272756b389828a70..e48b0939693f6ebc69ab5ccf02f7fdba52f0a027 100644 (file)
 
 void __init shmobile_init_delay(void)
 {
-       struct device_node *np, *cpus;
+       struct device_node *np;
        u32 max_freq = 0;
 
-       cpus = of_find_node_by_path("/cpus");
-       if (!cpus)
-               return;
-
-       for_each_child_of_node(cpus, np) {
+       for_each_of_cpu_node(np) {
                u32 freq;
 
                if (!of_property_read_u32(np, "clock-frequency", &freq))
                        max_freq = max(max_freq, freq);
        }
 
-       of_node_put(cpus);
-
        if (!max_freq)
                return;