aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base/bus.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/base/bus.c')
-rw-r--r--drivers/base/bus.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/base/bus.c b/drivers/base/bus.c
index 7d8a7ce73fb3..ed3e8a2be64a 100644
--- a/drivers/base/bus.c
+++ b/drivers/base/bus.c
@@ -724,6 +724,8 @@ int bus_register(struct bus_type * bus)
724{ 724{
725 int retval; 725 int retval;
726 726
727 BLOCKING_INIT_NOTIFIER_HEAD(&bus->bus_notifier);
728
727 retval = kobject_set_name(&bus->subsys.kset.kobj, "%s", bus->name); 729 retval = kobject_set_name(&bus->subsys.kset.kobj, "%s", bus->name);
728 if (retval) 730 if (retval)
729 goto out; 731 goto out;
@@ -782,6 +784,18 @@ void bus_unregister(struct bus_type * bus)
782 subsystem_unregister(&bus->subsys); 784 subsystem_unregister(&bus->subsys);
783} 785}
784 786
787int bus_register_notifier(struct bus_type *bus, struct notifier_block *nb)
788{
789 return blocking_notifier_chain_register(&bus->bus_notifier, nb);
790}
791EXPORT_SYMBOL_GPL(bus_register_notifier);
792
793int bus_unregister_notifier(struct bus_type *bus, struct notifier_block *nb)
794{
795 return blocking_notifier_chain_unregister(&bus->bus_notifier, nb);
796}
797EXPORT_SYMBOL_GPL(bus_unregister_notifier);
798
785int __init buses_init(void) 799int __init buses_init(void)
786{ 800{
787 return subsystem_register(&bus_subsys); 801 return subsystem_register(&bus_subsys);