Since device_add_child() needs the name of the parent driver, the root

device needs a driver_t object, too.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23025 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2007-11-30 09:40:52 +00:00
parent 2e3233d74e
commit 053693ef2a

View File

@ -42,6 +42,11 @@ int32 gDeviceCount;
static status_t
init_root_device(driver_t *driver, device_t *_root, device_t *_child)
{
static driver_t sRootDriver = {
"pci",
NULL,
sizeof(struct root_device_softc)
};
device_t child;
device_t root = device_add_child(NULL, NULL, 0);
@ -54,6 +59,8 @@ init_root_device(driver_t *driver, device_t *_root, device_t *_child)
return B_NO_MEMORY;
}
root->driver = &sRootDriver;
child = device_add_child(root, driver->name, 0);
if (child == NULL) {
device_delete_child(NULL, root);