[PATCH 2/3] convert cpu_to_l2cache() to of_find_next_cache_node()

Nathan Lynch ntl at pobox.com
Thu Dec 11 11:46:05 EST 2008


The smp code uses cache information to populate cpu_core_map; change
it to use common code for cache lookup.

Signed-off-by: Nathan Lynch <ntl at pobox.com>
---
 arch/powerpc/kernel/smp.c |   10 +---------
 1 files changed, 1 insertions(+), 9 deletions(-)

diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c
index ff9f701..450865b 100644
--- a/arch/powerpc/kernel/smp.c
+++ b/arch/powerpc/kernel/smp.c
@@ -408,8 +408,6 @@ out:
 static struct device_node *cpu_to_l2cache(int cpu)
 {
 	struct device_node *np;
-	const phandle *php;
-	phandle ph;
 
 	if (!cpu_present(cpu))
 		return NULL;
@@ -418,13 +416,7 @@ static struct device_node *cpu_to_l2cache(int cpu)
 	if (np == NULL)
 		return NULL;
 
-	php = of_get_property(np, "l2-cache", NULL);
-	if (php == NULL)
-		return NULL;
-	ph = *php;
-	of_node_put(np);
-
-	return of_find_node_by_phandle(ph);
+	return of_find_next_cache_node(np);
 }
 
 /* Activate a secondary processor. */
-- 
1.5.5




More information about the Linuxppc-dev mailing list