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 <[EMAIL PROTECTED]>
---
 arch/powerpc/kernel/smp.c |   11 ++++-------
 1 files changed, 4 insertions(+), 7 deletions(-)

v2: Fix refcount imbalance, thanks to sfr.

diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c
index ff9f701..a112ba9 100644
--- a/arch/powerpc/kernel/smp.c
+++ b/arch/powerpc/kernel/smp.c
@@ -408,8 +408,7 @@ out:
 static struct device_node *cpu_to_l2cache(int cpu)
 {
        struct device_node *np;
-       const phandle *php;
-       phandle ph;
+       struct device_node *cache;
 
        if (!cpu_present(cpu))
                return NULL;
@@ -418,13 +417,11 @@ 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;
+       cache = of_find_next_cache_node(np);
+
        of_node_put(np);
 
-       return of_find_node_by_phandle(ph);
+       return cache;
 }
 
 /* Activate a secondary processor. */
-- 
1.5.5

_______________________________________________
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

Reply via email to