提交 5af5d40c 编写于 作者: R Rob Herring

ARM: shmobile: use for_each_of_cpu_node iterator

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: NGeert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: NSimon Horman <horms+renesas@verge.net.au>
Signed-off-by: NRob Herring <robh@kernel.org>
上级 07d44f1f
...@@ -50,7 +50,7 @@ void __init rcar_gen2_pm_init(void) ...@@ -50,7 +50,7 @@ void __init rcar_gen2_pm_init(void)
void __iomem *p; void __iomem *p;
u32 bar; u32 bar;
static int once; static int once;
struct device_node *np, *cpus; struct device_node *np;
bool has_a7 = false; bool has_a7 = false;
bool has_a15 = false; bool has_a15 = false;
struct resource res; struct resource res;
...@@ -59,11 +59,7 @@ void __init rcar_gen2_pm_init(void) ...@@ -59,11 +59,7 @@ void __init rcar_gen2_pm_init(void)
if (once++) if (once++)
return; return;
cpus = of_find_node_by_path("/cpus"); for_each_of_cpu_node(np) {
if (!cpus)
return;
for_each_child_of_node(cpus, np) {
if (of_device_is_compatible(np, "arm,cortex-a15")) if (of_device_is_compatible(np, "arm,cortex-a15"))
has_a15 = true; has_a15 = true;
else if (of_device_is_compatible(np, "arm,cortex-a7")) else if (of_device_is_compatible(np, "arm,cortex-a7"))
......
...@@ -202,7 +202,7 @@ static void __init get_special_pds(void) ...@@ -202,7 +202,7 @@ static void __init get_special_pds(void)
const struct of_device_id *id; const struct of_device_id *id;
/* PM domains containing CPUs */ /* PM domains containing CPUs */
for_each_node_by_type(np, "cpu") for_each_of_cpu_node(np)
add_special_pd(np, PD_CPU); add_special_pd(np, PD_CPU);
/* PM domain containing console */ /* PM domain containing console */
......
...@@ -22,22 +22,16 @@ ...@@ -22,22 +22,16 @@
void __init shmobile_init_delay(void) void __init shmobile_init_delay(void)
{ {
struct device_node *np, *cpus; struct device_node *np;
u32 max_freq = 0; u32 max_freq = 0;
cpus = of_find_node_by_path("/cpus"); for_each_of_cpu_node(np) {
if (!cpus)
return;
for_each_child_of_node(cpus, np) {
u32 freq; u32 freq;
if (!of_property_read_u32(np, "clock-frequency", &freq)) if (!of_property_read_u32(np, "clock-frequency", &freq))
max_freq = max(max_freq, freq); max_freq = max(max_freq, freq);
} }
of_node_put(cpus);
if (!max_freq) if (!max_freq)
return; return;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册