Skip to content

Commit

Permalink
c6x: use for_each_of_cpu_node iterator
Browse files Browse the repository at this point in the history
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: Mark Salter <[email protected]>
Cc: Aurelien Jacquiot <[email protected]>
Cc: [email protected]
Signed-off-by: Rob Herring <[email protected]>
  • Loading branch information
robherring committed Sep 28, 2018
1 parent de76e70 commit 5a931a3
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions arch/c6x/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ static void __init get_cpuinfo(void)
unsigned long core_khz;
u64 tmp;
struct cpuinfo_c6x *p;
struct device_node *node, *np;
struct device_node *node;

p = &per_cpu(cpu_data, smp_processor_id());

Expand Down Expand Up @@ -190,13 +190,8 @@ static void __init get_cpuinfo(void)

p->core_id = get_coreid();

node = of_find_node_by_name(NULL, "cpus");
if (node) {
for_each_child_of_node(node, np)
if (!strcmp("cpu", np->name))
++c6x_num_cores;
of_node_put(node);
}
for_each_of_cpu_node(node)
++c6x_num_cores;

node = of_find_node_by_name(NULL, "soc");
if (node) {
Expand Down

0 comments on commit 5a931a3

Please sign in to comment.