diff options
author | Magnus Damm <damm@opensource.se> | 2010-07-23 19:56:18 +0900 |
---|---|---|
committer | Jonas ABERG <jonas.aberg@stericsson.com> | 2010-12-14 07:45:48 +0100 |
commit | 7893c2ae6db622bcdc555c8f877cf4136fa475e4 (patch) | |
tree | 2cd02d6bee2902dd8d88b04875593b1f93d1e944 /drivers/base | |
parent | b3769b16acd2758385a919bb7166cf13161afb04 (diff) |
Driver core: Add BUS_NOTIFY_BIND_DRIVER
Add BUS_NOTIFY_BIND_DRIVER as a bus notifier event.
For driver binding/unbinding we with this in
place have the following bus notifier events:
- BUS_NOTIFY_BIND_DRIVER - before ->probe()
- BUS_NOTIFY_BOUND_DRIVER - after ->probe()
- BUS_NOTIFY_UNBIND_DRIVER - before ->remove()
- BUS_NOTIFY_UNBOUND_DRIVER - after ->remove()
The event BUS_NOTIFY_BIND_DRIVER allows bus code
to be notified that ->probe() is about to be called.
Useful for bus code that needs to setup hardware before
the driver gets to run. With this in place platform
drivers can be loaded and unloaded as modules and the
new BIND event allows bus code to control for instance
device clocks that must be enabled before the driver
can be executed.
Without this patch there is no way for the bus code to
get notified that a modular driver is about to be probed.
Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Change-Id: Ic147d869eabadc5ce0108704d50d04c71e89a557
Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/10572
Reviewed-by: QATOOLS
Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
Tested-by: Rabin VINCENT <rabin.vincent@stericsson.com>
Diffstat (limited to 'drivers/base')
-rw-r--r-- | drivers/base/dd.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/base/dd.c b/drivers/base/dd.c index 503c2620bbc..da57ee9d63f 100644 --- a/drivers/base/dd.c +++ b/drivers/base/dd.c @@ -51,6 +51,10 @@ static int driver_sysfs_add(struct device *dev) { int ret; + if (dev->bus) + blocking_notifier_call_chain(&dev->bus->p->bus_notifier, + BUS_NOTIFY_BIND_DRIVER, dev); + ret = sysfs_create_link(&dev->driver->p->kobj, &dev->kobj, kobject_name(&dev->kobj)); if (ret == 0) { |