Skip to content

Commit

Permalink
arm64: Use of_cpu_node_to_id helper for CPU topology parsing
Browse files Browse the repository at this point in the history
Make use of the new generic helper to convert an of_node of a CPU
to the logical CPU id in parsing the topology.

Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Leo Yan <leo.yan@linaro.org>
Cc: Will Deacon <will.deacon@arm.com>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
  • Loading branch information
Suzuki K Poulose authored and Will Deacon committed Jan 2, 2018
1 parent c08ec7d commit 52cac11
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions arch/arm64/kernel/topology.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,14 @@ static int __init get_cpu_for_node(struct device_node *node)
if (!cpu_node)
return -1;

for_each_possible_cpu(cpu) {
if (of_get_cpu_node(cpu, NULL) == cpu_node) {
topology_parse_cpu_capacity(cpu_node, cpu);
of_node_put(cpu_node);
return cpu;
}
}

pr_crit("Unable to find CPU node for %pOF\n", cpu_node);
cpu = of_cpu_node_to_id(cpu_node);
if (cpu >= 0)
topology_parse_cpu_capacity(cpu_node, cpu);
else
pr_crit("Unable to find CPU node for %pOF\n", cpu_node);

of_node_put(cpu_node);
return -1;
return cpu;
}

static int __init parse_core(struct device_node *core, int cluster_id,
Expand Down

0 comments on commit 52cac11

Please sign in to comment.