aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMilton Miller <miltonm@bga.com>2009-01-07 21:19:45 -0500
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2009-02-10 21:37:59 -0500
commit8b16cd238d414b8942a23f0f753cdc57b17c231a (patch)
treea66ea5d382ecf4b89797af0bf933e5694fb53db0
parent20fcefe5a0a354b0cc78ec4634d9f72dab5f1ee9 (diff)
powerpc/numa: Remove redundant find_cpu_node()
Use of_get_cpu_node, which is a superset of numa.c's find_cpu_node in a less restrictive section (text vs cpuinit). Signed-off-by: Milton Miller <miltonm@bga.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
-rw-r--r--arch/powerpc/mm/numa.c33
1 files changed, 2 insertions, 31 deletions
diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c
index e26d5e5c22be..c81e74790a8c 100644
--- a/arch/powerpc/mm/numa.c
+++ b/arch/powerpc/mm/numa.c
@@ -157,35 +157,6 @@ static void unmap_cpu_from_node(unsigned long cpu)
157} 157}
158#endif /* CONFIG_HOTPLUG_CPU */ 158#endif /* CONFIG_HOTPLUG_CPU */
159 159
160static struct device_node * __cpuinit find_cpu_node(unsigned int cpu)
161{
162 unsigned int hw_cpuid = get_hard_smp_processor_id(cpu);
163 struct device_node *cpu_node = NULL;
164 const unsigned int *interrupt_server, *reg;
165 int len;
166
167 while ((cpu_node = of_find_node_by_type(cpu_node, "cpu")) != NULL) {
168 /* Try interrupt server first */
169 interrupt_server = of_get_property(cpu_node,
170 "ibm,ppc-interrupt-server#s", &len);
171
172 len = len / sizeof(u32);
173
174 if (interrupt_server && (len > 0)) {
175 while (len--) {
176 if (interrupt_server[len] == hw_cpuid)
177 return cpu_node;
178 }
179 } else {
180 reg = of_get_property(cpu_node, "reg", &len);
181 if (reg && (len > 0) && (reg[0] == hw_cpuid))
182 return cpu_node;
183 }
184 }
185
186 return NULL;
187}
188
189/* must hold reference to node during call */ 160/* must hold reference to node during call */
190static const int *of_get_associativity(struct device_node *dev) 161static const int *of_get_associativity(struct device_node *dev)
191{ 162{
@@ -469,7 +440,7 @@ static int of_drconf_to_nid_single(struct of_drconf_cell *drmem,
469static int __cpuinit numa_setup_cpu(unsigned long lcpu) 440static int __cpuinit numa_setup_cpu(unsigned long lcpu)
470{ 441{
471 int nid = 0; 442 int nid = 0;
472 struct device_node *cpu = find_cpu_node(lcpu); 443 struct device_node *cpu = of_get_cpu_node(lcpu, NULL);
473 444
474 if (!cpu) { 445 if (!cpu) {
475 WARN_ON(1); 446 WARN_ON(1);
@@ -651,7 +622,7 @@ static int __init parse_numa_properties(void)
651 for_each_present_cpu(i) { 622 for_each_present_cpu(i) {
652 int nid; 623 int nid;
653 624
654 cpu = find_cpu_node(i); 625 cpu = of_get_cpu_node(i, NULL);
655 BUG_ON(!cpu); 626 BUG_ON(!cpu);
656 nid = of_node_to_nid_single(cpu); 627 nid = of_node_to_nid_single(cpu);
657 of_node_put(cpu); 628 of_node_put(cpu);