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:
parent
2e3233d74e
commit
053693ef2a
@ -42,6 +42,11 @@ int32 gDeviceCount;
|
|||||||
static status_t
|
static status_t
|
||||||
init_root_device(driver_t *driver, device_t *_root, device_t *_child)
|
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 child;
|
||||||
|
|
||||||
device_t root = device_add_child(NULL, NULL, 0);
|
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;
|
return B_NO_MEMORY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
root->driver = &sRootDriver;
|
||||||
|
|
||||||
child = device_add_child(root, driver->name, 0);
|
child = device_add_child(root, driver->name, 0);
|
||||||
if (child == NULL) {
|
if (child == NULL) {
|
||||||
device_delete_child(NULL, root);
|
device_delete_child(NULL, root);
|
||||||
|
Loading…
Reference in New Issue
Block a user