Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

arm_pmu: Use of_cpu_node_to_id helper

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.

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>

authored by

Suzuki K Poulose and committed by
Will Deacon
66582787 52cac110

+3 -12
+3 -12
drivers/perf/arm_pmu_platform.c
··· 82 82 return -EINVAL; 83 83 } 84 84 85 - /* Now look up the logical CPU number */ 86 - for_each_possible_cpu(cpu) { 87 - struct device_node *cpu_dn; 88 - 89 - cpu_dn = of_cpu_device_node_get(cpu); 90 - of_node_put(cpu_dn); 91 - 92 - if (dn == cpu_dn) 93 - break; 94 - } 95 - 96 - if (cpu >= nr_cpu_ids) { 85 + cpu = of_cpu_node_to_id(dn); 86 + if (cpu < 0) { 97 87 pr_warn("failed to find logical CPU for %s\n", dn->name); 88 + cpu = nr_cpu_ids; 98 89 } 99 90 100 91 of_node_put(dn);