Skip to content

Commit

Permalink
powerpc: Convert cpu_to_l2cache() to of_find_next_cache_node()
Browse files Browse the repository at this point in the history
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@pobox.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
  • Loading branch information
Nathan Lynch authored and Paul Mackerras committed Dec 21, 2008
1 parent e523f72 commit b2ea25b
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions arch/powerpc/kernel/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -466,8 +466,7 @@ int cpu_to_core_id(int cpu)
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;
Expand All @@ -476,13 +475,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. */
Expand Down

0 comments on commit b2ea25b

Please sign in to comment.