summaryrefslogtreecommitdiffstats
path: root/drivers/base/driver.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/base/driver.c')
-rw-r--r--drivers/base/driver.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/base/driver.c b/drivers/base/driver.c
index dc2df91522..c2e681934f 100644
--- a/drivers/base/driver.c
+++ b/drivers/base/driver.c
@@ -125,6 +125,11 @@ int register_device(struct device_d *new_device)
if (!new_device->bus)
return 0;
+ if (!new_device->parent) {
+ new_device->parent = &new_device->bus->dev;
+ dev_add_child(new_device->parent, new_device);
+ }
+
list_add_tail(&new_device->bus_list, &new_device->bus->device_list);
bus_for_each_driver(new_device->bus, drv) {