diff options
author | David S. Miller <davem@sunset.davemloft.net> | 2006-06-23 18:55:17 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-06-24 02:15:47 -0400 |
commit | fd5314311634245172d40ccb418d89dac91d6ad6 (patch) | |
tree | a157e4f2ec03316d733de1ff5c64254d8068d078 /arch/sparc/kernel/ebus.c | |
parent | 942a6bdd1c4d2419a42be77ba1c964e4ba8dae9e (diff) |
[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 | |||
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; |