diff options
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 | |||
235 | } | 235 | } |
236 | } | 236 | } |
237 | 237 | ||
238 | dev->ofdev.node = dp; | ||
239 | dev->ofdev.dev.parent = &dev->bus->ofdev.dev; | ||
240 | dev->ofdev.dev.bus = &ebus_bus_type; | ||
241 | strcpy(dev->ofdev.dev.bus_id, dp->path_component_name); | ||
242 | |||
243 | /* Register with core */ | ||
244 | if (of_device_register(&dev->ofdev) != 0) | ||
245 | printk(KERN_DEBUG "ebus: device registration error for %s!\n", | ||
246 | dev->ofdev.dev.bus_id); | ||
247 | |||
238 | if ((dp = dp->child) != NULL) { | 248 | if ((dp = dp->child) != NULL) { |
239 | dev->children = (struct linux_ebus_child *) | 249 | dev->children = (struct linux_ebus_child *) |
240 | ebus_alloc(sizeof(struct linux_ebus_child)); | 250 | ebus_alloc(sizeof(struct linux_ebus_child)); |
@@ -321,6 +331,17 @@ void __init ebus_init(void) | |||
321 | *base++ = addr; | 331 | *base++ = addr; |
322 | } | 332 | } |
323 | 333 | ||
334 | ebus->ofdev.node = dp; | ||
335 | ebus->ofdev.dev.parent = &pdev->dev; | ||
336 | ebus->ofdev.dev.bus = &ebus_bus_type; | ||
337 | strcpy(ebus->ofdev.dev.bus_id, dp->path_component_name); | ||
338 | |||
339 | /* Register with core */ | ||
340 | if (of_device_register(&ebus->ofdev) != 0) | ||
341 | printk(KERN_DEBUG "ebus: device registration error for %s!\n", | ||
342 | ebus->ofdev.dev.bus_id); | ||
343 | |||
344 | |||
324 | nd = dp->child; | 345 | nd = dp->child; |
325 | if (!nd) | 346 | if (!nd) |
326 | goto next_ebus; | 347 | goto next_ebus; |