Commit 8746ed3d authored by Kim Phillips's avatar Kim Phillips Committed by Paul Mackerras

[POWERPC] Fix ucc_geth of_device discovery on mpc832x

mpc832x, as in mpc8360, needs to explicitly find and create the
platform device for ucc_geth in 2.6.19.  This code will likely be
readapted to Benh's new of_ methods for 2.6.20.
Signed-off-by: default avatarKim Phillips <kim.phillips@freescale.com>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent df9c2309
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#include <linux/root_dev.h> #include <linux/root_dev.h>
#include <linux/initrd.h> #include <linux/initrd.h>
#include <asm/of_device.h>
#include <asm/system.h> #include <asm/system.h>
#include <asm/atomic.h> #include <asm/atomic.h>
#include <asm/time.h> #include <asm/time.h>
...@@ -136,6 +137,24 @@ static void __init mpc832x_sys_setup_arch(void) ...@@ -136,6 +137,24 @@ static void __init mpc832x_sys_setup_arch(void)
#endif #endif
} }
static int __init mpc832x_declare_of_platform_devices(void)
{
struct device_node *np;
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);
}
return 0;
}
device_initcall(mpc832x_declare_of_platform_devices);
void __init mpc832x_sys_init_IRQ(void) void __init mpc832x_sys_init_IRQ(void)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment