diff options
author | David S. Miller <davem@sunset.davemloft.net> | 2006-06-24 00:55:17 +0200 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-06-24 08:15:47 +0200 |
commit | fd5314311634245172d40ccb418d89dac91d6ad6 (patch) | |
tree | a157e4f2ec03316d733de1ff5c64254d8068d078 /arch/sparc/kernel/ebus.c | |
parent | [SPARC]: Port sparc64 in-kernel device tree code to sparc32. (diff) | |
download | linux-fd5314311634245172d40ccb418d89dac91d6ad6.tar.xz linux-fd5314311634245172d40ccb418d89dac91d6ad6.zip |
[SPARC]: Port of_device layer and make ebus use it.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc/kernel/ebus.c')
-rw-r--r-- | arch/sparc/kernel/ebus.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/arch/sparc/kernel/ebus.c b/arch/sparc/kernel/ebus.c index 9d461da76399..a7a4892956c8 100644 --- a/arch/sparc/kernel/ebus.c +++ b/arch/sparc/kernel/ebus.c @@ -235,6 +235,16 @@ void __init fill_ebus_device(struct device_node *dp, struct linux_ebus_device *d } } + dev->ofdev.node = dp; + dev->ofdev.dev.parent = &dev->bus->ofdev.dev; + dev->ofdev.dev.bus = &ebus_bus_type; + strcpy(dev->ofdev.dev.bus_id, dp->path_component_name); + + /* Register with core */ + if (of_device_register(&dev->ofdev) != 0) + printk(KERN_DEBUG "ebus: device registration error for %s!\n", + dev->ofdev.dev.bus_id); + if ((dp = dp->child) != NULL) { dev->children = (struct linux_ebus_child *) ebus_alloc(sizeof(struct linux_ebus_child)); @@ -321,6 +331,17 @@ void __init ebus_init(void) *base++ = addr; } + ebus->ofdev.node = dp; + ebus->ofdev.dev.parent = &pdev->dev; + ebus->ofdev.dev.bus = &ebus_bus_type; + strcpy(ebus->ofdev.dev.bus_id, dp->path_component_name); + + /* Register with core */ + if (of_device_register(&ebus->ofdev) != 0) + printk(KERN_DEBUG "ebus: device registration error for %s!\n", + ebus->ofdev.dev.bus_id); + + nd = dp->child; if (!nd) goto next_ebus; |