diff options
author | Andre Detsch <adetsch@br.ibm.com> | 2007-12-04 21:49:31 -0500 |
---|---|---|
committer | Arnd Bergmann <arnd@arndb.de> | 2007-12-18 19:00:03 -0500 |
commit | a0a7ae8939e3fdecf5478ddba54562e23de7ca1d (patch) | |
tree | b8145e435a6f982c5c64bbec3728314a4b83a9d0 | |
parent | 3ce2f62b05eca594356fc477229e233e2678b509 (diff) |
[POWERPC] cell: safer of_has_vicinity routine
This patch changes the way we check for the existence of
vicinity property in spe device nodes.
The new implementation does not depend on having an initialized
cbe_spu_info[0].spus, and checks for presence of vicinity in all
nodes, not only in the first one.
Signed-off-by: Andre Detsch <adetsch@br.ibm.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
-rw-r--r-- | arch/powerpc/platforms/cell/spu_manage.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/arch/powerpc/platforms/cell/spu_manage.c b/arch/powerpc/platforms/cell/spu_manage.c index b36ed62a39cc..9979197ff409 100644 --- a/arch/powerpc/platforms/cell/spu_manage.c +++ b/arch/powerpc/platforms/cell/spu_manage.c | |||
@@ -411,10 +411,15 @@ static void init_affinity_qs20_harcoded(void) | |||
411 | 411 | ||
412 | static int of_has_vicinity(void) | 412 | static int of_has_vicinity(void) |
413 | { | 413 | { |
414 | struct spu* spu; | 414 | struct device_node *dn; |
415 | 415 | ||
416 | spu = list_first_entry(&cbe_spu_info[0].spus, struct spu, cbe_list); | 416 | for_each_node_by_type(dn, "spe") { |
417 | return of_find_property(spu_devnode(spu), "vicinity", NULL) != NULL; | 417 | if (of_find_property(dn, "vicinity", NULL)) { |
418 | of_node_put(dn); | ||
419 | return 1; | ||
420 | } | ||
421 | } | ||
422 | return 0; | ||
418 | } | 423 | } |
419 | 424 | ||
420 | static struct spu *devnode_spu(int cbe, struct device_node *dn) | 425 | static struct spu *devnode_spu(int cbe, struct device_node *dn) |