aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKumar Gala <galak@kernel.crashing.org>2007-02-17 10:56:49 -0500
committerKumar Gala <galak@kernel.crashing.org>2007-02-17 10:56:49 -0500
commitf7993ed57ac06da168d29c587d1bc0dce0f11c78 (patch)
tree443ffead2e02606e1f331ab8e9e0f77995f58b31
parent7c90c800d9a6c6393fa610313b6ed56ac786da93 (diff)
[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 <galak@kernel.crashing.org>
-rw-r--r--arch/powerpc/platforms/83xx/mpc832x_mds.c22
-rw-r--r--arch/powerpc/platforms/83xx/mpc8360e_pb.c24
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 980d45c6bd35..17e3a3c6d8b4 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)
105 iounmap(bcsr_regs); 105 iounmap(bcsr_regs);
106 of_node_put(np); 106 of_node_put(np);
107 } 107 }
108
109#endif /* CONFIG_QUICC_ENGINE */ 108#endif /* CONFIG_QUICC_ENGINE */
110} 109}
111 110
111static struct of_device_id mpc832x_ids[] = {
112 { .type = "soc", },
113 { .compatible = "soc", },
114 { .type = "qe", },
115 {},
116};
117
112static int __init mpc832x_declare_of_platform_devices(void) 118static int __init mpc832x_declare_of_platform_devices(void)
113{ 119{
114 struct device_node *np;
115
116 if (!machine_is(mpc832x_mds)) 120 if (!machine_is(mpc832x_mds))
117 return 0; 121 return 0;
118 122
119 for (np = NULL; (np = of_find_compatible_node(np, "network", 123 /* Publish the QE devices */
120 "ucc_geth")) != NULL;) { 124 of_platform_bus_probe(NULL, mpc832x_ids, NULL);
121 int ucc_num;
122 char bus_id[BUS_ID_SIZE];
123
124 ucc_num = *((uint *) get_property(np, "device-id", NULL)) - 1;
125 snprintf(bus_id, BUS_ID_SIZE, "ucc_geth.%u", ucc_num);
126 of_platform_device_create(np, bus_id, NULL);
127 }
128 125
129 return 0; 126 return 0;
130} 127}
@@ -132,7 +129,6 @@ device_initcall(mpc832x_declare_of_platform_devices);
132 129
133static void __init mpc832x_sys_init_IRQ(void) 130static void __init mpc832x_sys_init_IRQ(void)
134{ 131{
135
136 struct device_node *np; 132 struct device_node *np;
137 133
138 np = of_find_node_by_type(NULL, "ipic"); 134 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 83f1c94274d0..b25e6a116233 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)
119#endif /* CONFIG_QUICC_ENGINE */ 119#endif /* CONFIG_QUICC_ENGINE */
120} 120}
121 121
122static int __init mpc8360_declare_of_platform_devices(void) 122static struct of_device_id mpc836x_ids[] = {
123{ 123 { .type = "soc", },
124 struct device_node *np; 124 { .compatible = "soc", },
125 { .type = "qe", },
126 {},
127};
125 128
129static int __init mpc836x_declare_of_platform_devices(void)
130{
126 if (!machine_is(mpc8360_sys)) 131 if (!machine_is(mpc8360_sys))
127 return 0; 132 return 0;
128 133
129 for (np = NULL; (np = of_find_compatible_node(np, "network", 134 /* Publish the QE devices */
130 "ucc_geth")) != NULL;) { 135 of_platform_bus_probe(NULL, mpc836x_ids, NULL);
131 int ucc_num;
132 char bus_id[BUS_ID_SIZE];
133
134 ucc_num = *((uint *) get_property(np, "device-id", NULL)) - 1;
135 snprintf(bus_id, BUS_ID_SIZE, "ucc_geth.%u", ucc_num);
136 of_platform_device_create(np, bus_id, NULL);
137 }
138 136
139 return 0; 137 return 0;
140} 138}
141device_initcall(mpc8360_declare_of_platform_devices); 139device_initcall(mpc836x_declare_of_platform_devices);
142 140
143static void __init mpc8360_sys_init_IRQ(void) 141static void __init mpc8360_sys_init_IRQ(void)
144{ 142{