ARM: perf: replace arch_find_n_match_cpu_physical_id with of_cpu_device_node_get
authorSudeep Holla <sudeep.holla@arm.com>
Tue, 30 Jun 2015 12:56:57 +0000 (13:56 +0100)
committerWill Deacon <will.deacon@arm.com>
Fri, 31 Jul 2015 14:01:14 +0000 (15:01 +0100)
arch_find_n_match_cpu_physical_id parses the device tree to get the
device node for a given logical cpu index. However, since ARM PMUs get
probed after the CPU device nodes are stashed while registering the
cpus, we can use of_cpu_device_node_get to avoid another DT parse.

This patch replaces arch_find_n_match_cpu_physical_id with
of_cpu_device_node_get to reuse the stashed value directly instead.

Cc: Will Deacon <will.deacon@arm.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
arch/arm/kernel/perf_event.c

index 5a8f17bfcc6025043253233222e0c271039fa917..1cb40651d7838a96e280be4aae9480c30b467b42 100644 (file)
@@ -15,7 +15,7 @@
 #include <linux/cpumask.h>
 #include <linux/export.h>
 #include <linux/kernel.h>
-#include <linux/of.h>
+#include <linux/of_device.h>
 #include <linux/platform_device.h>
 #include <linux/slab.h>
 #include <linux/spinlock.h>
@@ -824,7 +824,7 @@ static int of_pmu_irq_cfg(struct arm_pmu *pmu)
 
                /* Now look up the logical CPU number */
                for_each_possible_cpu(cpu)
-                       if (arch_find_n_match_cpu_physical_id(dn, cpu, NULL))
+                       if (dn == of_cpu_device_node_get(cpu))
                                break;
 
                if (cpu >= nr_cpu_ids) {