aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>2013-07-23 07:32:42 -0400
committerJason Cooper <jason@lakedaemon.net>2013-08-09 09:02:51 -0400
commita7160b7eaf2d914e1b552807b9d13acf23b47293 (patch)
tree67169749cf60bd10da936efb44fd4dad0ca3de65
parentad81f0545ef01ea651886dddac4bef6cec930092 (diff)
ARM: mach-mvebu: remove redundant DT parsing and validation
arm_dt_init_cpu_maps parses the device tree, validates and sets the cpu_possible_mask appropriately. It is unnecessary to do another DT parse to get the number of cpus, use num_possible_cpus instead. Cc: Gregory Clement <gregory.clement@free-electrons.com> Cc: Jason Cooper <jason@lakedaemon.net> Cc: Andrew Lunn <andrew@lunn.ch> Signed-off-by: Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com> Acked-by: Gregory Clement <gregory.clement@free-electrons.com> Signed-off-by: Jason Cooper <jason@lakedaemon.net>
-rw-r--r--arch/arm/mach-mvebu/platsmp.c19
1 files changed, 1 insertions, 18 deletions
diff --git a/arch/arm/mach-mvebu/platsmp.c b/arch/arm/mach-mvebu/platsmp.c
index 93f2f3ab45f1..9ccbbdb89a4d 100644
--- a/arch/arm/mach-mvebu/platsmp.c
+++ b/arch/arm/mach-mvebu/platsmp.c
@@ -88,28 +88,11 @@ static int __cpuinit armada_xp_boot_secondary(unsigned int cpu,
88 88
89static void __init armada_xp_smp_init_cpus(void) 89static void __init armada_xp_smp_init_cpus(void)
90{ 90{
91 struct device_node *np; 91 unsigned int ncores = num_possible_cpus();
92 unsigned int i, ncores;
93 92
94 np = of_find_node_by_name(NULL, "cpus");
95 if (!np)
96 panic("No 'cpus' node found\n");
97
98 ncores = of_get_child_count(np);
99 if (ncores == 0 || ncores > ARMADA_XP_MAX_CPUS) 93 if (ncores == 0 || ncores > ARMADA_XP_MAX_CPUS)
100 panic("Invalid number of CPUs in DT\n"); 94 panic("Invalid number of CPUs in DT\n");
101 95
102 /* Limit possible CPUs to defconfig */
103 if (ncores > nr_cpu_ids) {
104 pr_warn("SMP: %d CPUs physically present. Only %d configured.",
105 ncores, nr_cpu_ids);
106 pr_warn("Clipping CPU count to %d\n", nr_cpu_ids);
107 ncores = nr_cpu_ids;
108 }
109
110 for (i = 0; i < ncores; i++)
111 set_cpu_possible(i, true);
112
113 set_smp_cross_call(armada_mpic_send_doorbell); 96 set_smp_cross_call(armada_mpic_send_doorbell);
114} 97}
115 98