Skip to content

Commit

Permalink
arm_pmu: Use of_cpu_node_to_id helper
Browse files Browse the repository at this point in the history
Use the new generic helper, of_cpu_node_to_id(), to map a
a phandle to the logical CPU number while parsing the
PMU irq affinity.

Change-Id: Iec4e1d032715838b5a468e1e4de417b72038bb7d
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>
Git-commit: 6658278
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
Signed-off-by: Raghavendra Rao Ananta <rananta@codeaurora.org>
  • Loading branch information
Suzuki K Poulose authored and Raghavendra Rao Ananta committed Mar 22, 2018
1 parent d9823bf commit 615c8a7
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions drivers/perf/arm_pmu_platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,19 +82,10 @@ static int pmu_parse_irq_affinity(struct device_node *node, int i)
return -EINVAL;
}

/* Now look up the logical CPU number */
for_each_possible_cpu(cpu) {
struct device_node *cpu_dn;

cpu_dn = of_cpu_device_node_get(cpu);
of_node_put(cpu_dn);

if (dn == cpu_dn)
break;
}

if (cpu >= nr_cpu_ids) {
cpu = of_cpu_node_to_id(dn);
if (cpu < 0) {
pr_warn("failed to find logical CPU for %s\n", dn->name);
cpu = nr_cpu_ids;
}

of_node_put(dn);
Expand Down

0 comments on commit 615c8a7

Please sign in to comment.