Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f7993ed57ac06da168d29c587d1bc0dce0f11c78
Commit:     f7993ed57ac06da168d29c587d1bc0dce0f11c78
Parent:     7c90c800d9a6c6393fa610313b6ed56ac786da93
Author:     Kumar Gala <[EMAIL PROTECTED]>
AuthorDate: Sat Feb 17 09:56:49 2007 -0600
Committer:  Kumar Gala <[EMAIL PROTECTED]>
CommitDate: Sat Feb 17 09:56:49 2007 -0600

    [POWERPC] 83xx: Use of_platform_bus_probe to setup QE devices
    
    Use of_platform_bus_probe to setup devices on the of_platform_bus since its
    much cleaner.  We explicitly specify the bus ids since the we want to get 
rid
    of the default mechanism in the future.
    
    Signed-off-by: Kumar Gala <[EMAIL PROTECTED]>
---
 arch/powerpc/platforms/83xx/mpc832x_mds.c |   22 +++++++++-------------
 arch/powerpc/platforms/83xx/mpc8360e_pb.c |   24 +++++++++++-------------
 2 files changed, 20 insertions(+), 26 deletions(-)

diff --git a/arch/powerpc/platforms/83xx/mpc832x_mds.c 
b/arch/powerpc/platforms/83xx/mpc832x_mds.c
index 980d45c..17e3a3c 100644
--- a/arch/powerpc/platforms/83xx/mpc832x_mds.c
+++ b/arch/powerpc/platforms/83xx/mpc832x_mds.c
@@ -105,26 +105,23 @@ static void __init mpc832x_sys_setup_arch(void)
                iounmap(bcsr_regs);
                of_node_put(np);
        }
-
 #endif                         /* CONFIG_QUICC_ENGINE */
 }
 
+static struct of_device_id mpc832x_ids[] = {
+       { .type = "soc", },
+       { .compatible = "soc", },
+       { .type = "qe", },
+       {},
+};
+
 static int __init mpc832x_declare_of_platform_devices(void)
 {
-       struct device_node *np;
-
        if (!machine_is(mpc832x_mds))
                return 0;
 
-       for (np = NULL; (np = of_find_compatible_node(np, "network",
-                                       "ucc_geth")) != NULL;) {
-               int ucc_num;
-               char bus_id[BUS_ID_SIZE];
-
-               ucc_num = *((uint *) get_property(np, "device-id", NULL)) - 1;
-               snprintf(bus_id, BUS_ID_SIZE, "ucc_geth.%u", ucc_num);
-               of_platform_device_create(np, bus_id, NULL);
-       }
+       /* Publish the QE devices */
+       of_platform_bus_probe(NULL, mpc832x_ids, NULL);
 
        return 0;
 }
@@ -132,7 +129,6 @@ device_initcall(mpc832x_declare_of_platform_devices);
 
 static void __init mpc832x_sys_init_IRQ(void)
 {
-
        struct device_node *np;
 
        np = of_find_node_by_type(NULL, "ipic");
diff --git a/arch/powerpc/platforms/83xx/mpc8360e_pb.c 
b/arch/powerpc/platforms/83xx/mpc8360e_pb.c
index 83f1c94..b25e6a1 100644
--- a/arch/powerpc/platforms/83xx/mpc8360e_pb.c
+++ b/arch/powerpc/platforms/83xx/mpc8360e_pb.c
@@ -119,26 +119,24 @@ static void __init mpc8360_sys_setup_arch(void)
 #endif                         /* CONFIG_QUICC_ENGINE */
 }
 
-static int __init mpc8360_declare_of_platform_devices(void)
-{
-       struct device_node *np;
+static struct of_device_id mpc836x_ids[] = {
+       { .type = "soc", },
+       { .compatible = "soc", },
+       { .type = "qe", },
+       {},
+};
 
+static int __init mpc836x_declare_of_platform_devices(void)
+{
        if (!machine_is(mpc8360_sys))
                return 0;
 
-       for (np = NULL; (np = of_find_compatible_node(np, "network",
-                                       "ucc_geth")) != NULL;) {
-               int ucc_num;
-               char bus_id[BUS_ID_SIZE];
-
-               ucc_num = *((uint *) get_property(np, "device-id", NULL)) - 1;
-               snprintf(bus_id, BUS_ID_SIZE, "ucc_geth.%u", ucc_num);
-               of_platform_device_create(np, bus_id, NULL);
-       }
+       /* Publish the QE devices */
+       of_platform_bus_probe(NULL, mpc836x_ids, NULL);
 
        return 0;
 }
-device_initcall(mpc8360_declare_of_platform_devices);
+device_initcall(mpc836x_declare_of_platform_devices);
 
 static void __init mpc8360_sys_init_IRQ(void)
 {
-
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