mirror of https://gitee.com/openkylin/linux.git
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: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Simon Horman <horms+renesas@verge.net.au> Signed-off-by: Rob Herring <robh@kernel.org>
This commit is contained in:
parent
07d44f1f82
commit
5af5d40c40
|
@ -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"))
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -22,22 +22,16 @@
|
|||
|
||||
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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue