aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base/dd.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/base/dd.c')
-rw-r--r--drivers/base/dd.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/base/dd.c b/drivers/base/dd.c
index c5d6bb4290ad..9c88b1e34bc3 100644
--- a/drivers/base/dd.c
+++ b/drivers/base/dd.c
@@ -52,6 +52,11 @@ int device_bind_driver(struct device *dev)
52 52
53 pr_debug("bound device '%s' to driver '%s'\n", 53 pr_debug("bound device '%s' to driver '%s'\n",
54 dev->bus_id, dev->driver->name); 54 dev->bus_id, dev->driver->name);
55
56 if (dev->bus)
57 blocking_notifier_call_chain(&dev->bus->bus_notifier,
58 BUS_NOTIFY_BOUND_DRIVER, dev);
59
55 klist_add_tail(&dev->knode_driver, &dev->driver->klist_devices); 60 klist_add_tail(&dev->knode_driver, &dev->driver->klist_devices);
56 ret = sysfs_create_link(&dev->driver->kobj, &dev->kobj, 61 ret = sysfs_create_link(&dev->driver->kobj, &dev->kobj,
57 kobject_name(&dev->kobj)); 62 kobject_name(&dev->kobj));
@@ -288,6 +293,11 @@ static void __device_release_driver(struct device * dev)
288 sysfs_remove_link(&dev->kobj, "driver"); 293 sysfs_remove_link(&dev->kobj, "driver");
289 klist_remove(&dev->knode_driver); 294 klist_remove(&dev->knode_driver);
290 295
296 if (dev->bus)
297 blocking_notifier_call_chain(&dev->bus->bus_notifier,
298 BUS_NOTIFY_UNBIND_DRIVER,
299 dev);
300
291 if (dev->bus && dev->bus->remove) 301 if (dev->bus && dev->bus->remove)
292 dev->bus->remove(dev); 302 dev->bus->remove(dev);
293 else if (drv->remove) 303 else if (drv->remove)