From fd5314311634245172d40ccb418d89dac91d6ad6 Mon Sep 17 00:00:00 2001 From: "David S. Miller" Date: Fri, 23 Jun 2006 15:55:17 -0700 Subject: [SPARC]: Port of_device layer and make ebus use it. Signed-off-by: David S. Miller --- arch/sparc/kernel/ebus.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'arch/sparc/kernel/ebus.c') 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; -- cgit v1.2.2