Commit b2ea25b9 authored by Nathan Lynch's avatar Nathan Lynch Committed by Paul Mackerras

powerpc: Convert cpu_to_l2cache() to of_find_next_cache_node()

The smp code uses cache information to populate cpu_core_map; change
it to use common code for cache lookup.
Signed-off-by: default avatarNathan Lynch <ntl@pobox.com>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent e523f723
...@@ -466,8 +466,7 @@ out: ...@@ -466,8 +466,7 @@ out:
static struct device_node *cpu_to_l2cache(int cpu) static struct device_node *cpu_to_l2cache(int cpu)
{ {
struct device_node *np; struct device_node *np;
const phandle *php; struct device_node *cache;
phandle ph;
if (!cpu_present(cpu)) if (!cpu_present(cpu))
return NULL; return NULL;
...@@ -476,13 +475,11 @@ static struct device_node *cpu_to_l2cache(int cpu) ...@@ -476,13 +475,11 @@ static struct device_node *cpu_to_l2cache(int cpu)
if (np == NULL) if (np == NULL)
return NULL; return NULL;
php = of_get_property(np, "l2-cache", NULL); cache = of_find_next_cache_node(np);
if (php == NULL)
return NULL;
ph = *php;
of_node_put(np); of_node_put(np);
return of_find_node_by_phandle(ph); return cache;
} }
/* Activate a secondary processor. */ /* Activate a secondary processor. */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment