Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f9234736112bf193e5ab451abbfbdf279cc53137
Commit:     f9234736112bf193e5ab451abbfbdf279cc53137
Parent:     683d00b03eb09a140e25d7f1457d347277bc2619
Author:     Scott Wood <[EMAIL PROTECTED]>
AuthorDate: Mon Aug 20 11:38:12 2007 -0500
Committer:  Kumar Gala <[EMAIL PROTECTED]>
CommitDate: Fri Sep 14 08:51:43 2007 -0500

    [POWERPC] fsl_soc.c cleanup
    
    1. Update the way get_brgfreq() finds things in the device tree.
    
    It now uses names that are less namespace polluting.  The old names
    are supported until all boards are converted.
    
    2. "size" is changed from unsigned int to int, to match what
    of_get_property() expects.
    
    Signed-off-by: Scott Wood <[EMAIL PROTECTED]>
    Signed-off-by: Kumar Gala <[EMAIL PROTECTED]>
---
 arch/powerpc/sysdev/fsl_soc.c |   27 +++++++++++++++++----------
 1 files changed, 17 insertions(+), 10 deletions(-)

diff --git a/arch/powerpc/sysdev/fsl_soc.c b/arch/powerpc/sysdev/fsl_soc.c
index f3abce1..7012e51 100644
--- a/arch/powerpc/sysdev/fsl_soc.c
+++ b/arch/powerpc/sysdev/fsl_soc.c
@@ -52,13 +52,13 @@ phys_addr_t get_immrbase(void)
 
        soc = of_find_node_by_type(NULL, "soc");
        if (soc) {
-               unsigned int size;
+               int size;
                const void *prop = of_get_property(soc, "reg", &size);
 
                if (prop)
                        immrbase = of_translate_address(soc, prop);
                of_node_put(soc);
-       };
+       }
 
        return immrbase;
 }
@@ -76,16 +76,23 @@ u32 get_brgfreq(void)
        if (brgfreq != -1)
                return brgfreq;
 
-       node = of_find_node_by_type(NULL, "cpm");
+       node = of_find_compatible_node(NULL, NULL, "fsl,cpm1");
+       if (!node)
+               node = of_find_compatible_node(NULL, NULL, "fsl,cpm2");
+       if (!node)
+               node = of_find_node_by_type(NULL, "cpm");
        if (node) {
-               unsigned int size;
-               const unsigned int *prop = of_get_property(node,
-                                       "brg-frequency", &size);
+               int size;
+               const unsigned int *prop;
 
-               if (prop)
+               prop = of_get_property(node, "fsl,brg-frequency", &size);
+               if (!prop)
+                       prop = of_get_property(node, "brg-frequency", &size);
+               if (prop && size == 4)
                        brgfreq = *prop;
+
                of_node_put(node);
-       };
+       }
 
        return brgfreq;
 }
@@ -103,14 +110,14 @@ u32 get_baudrate(void)
 
        node = of_find_node_by_type(NULL, "serial");
        if (node) {
-               unsigned int size;
+               int size;
                const unsigned int *prop = of_get_property(node,
                                "current-speed", &size);
 
                if (prop)
                        fs_baudrate = *prop;
                of_node_put(node);
-       };
+       }
 
        return fs_baudrate;
 }
-
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