Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=a0a7ae8939e3fdecf5478ddba54562e23de7ca1d
Commit:     a0a7ae8939e3fdecf5478ddba54562e23de7ca1d
Parent:     3ce2f62b05eca594356fc477229e233e2678b509
Author:     Andre Detsch <[EMAIL PROTECTED]>
AuthorDate: Wed Dec 5 13:49:31 2007 +1100
Committer:  Arnd Bergmann <[EMAIL PROTECTED]>
CommitDate: Wed Dec 19 01:00:03 2007 +0100

    [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 <[EMAIL PROTECTED]>
    Signed-off-by: Jeremy Kerr <[EMAIL PROTECTED]>
    Signed-off-by: Arnd Bergmann <[EMAIL PROTECTED]>
---
 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 b36ed62..9979197 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)
 
 static int of_has_vicinity(void)
 {
-       struct spu* spu;
+       struct device_node *dn;
 
-       spu = list_first_entry(&cbe_spu_info[0].spus, struct spu, cbe_list);
-       return of_find_property(spu_devnode(spu), "vicinity", NULL) != NULL;
+       for_each_node_by_type(dn, "spe") {
+               if (of_find_property(dn, "vicinity", NULL))  {
+                       of_node_put(dn);
+                       return 1;
+               }
+       }
+       return 0;
 }
 
 static struct spu *devnode_spu(int cbe, struct device_node *dn)
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to