]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
driver core: add way to get to bus kset
authorGreg Kroah-Hartman <gregkh@suse.de>
Fri, 2 Nov 2007 02:41:16 +0000 (19:41 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 25 Jan 2008 04:40:33 +0000 (20:40 -0800)
This allows an easier way to get to the kset associated with a struct
bus_type (you have three to choose from...)  This will make it easier to
move these fields to be dynamic in a future patch.

Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/base/bus.c
drivers/pci/hotplug/pci_hotplug_core.c
include/linux/device.h

index 871607b7c876ce67d78ca31f0477d8d1356bf67d..8335a1079b0efdebda537c1f5efdf8954d2adb63 100644 (file)
@@ -935,6 +935,12 @@ int bus_unregister_notifier(struct bus_type *bus, struct notifier_block *nb)
 }
 EXPORT_SYMBOL_GPL(bus_unregister_notifier);
 
+struct kset *bus_get_kset(struct bus_type *bus)
+{
+       return &bus->subsys;
+}
+EXPORT_SYMBOL_GPL(bus_get_kset);
+
 int __init buses_init(void)
 {
        bus_kset = kset_create_and_add("bus", &bus_uevent_ops, NULL);
index 0f05e6a68b3b7bcac5ec636266d2cb6288a12789..3606d5b52a70ffd6c6b3c85e859e2d6220f4b1fd 100644 (file)
@@ -699,9 +699,12 @@ int __must_check pci_hp_change_slot_info(struct hotplug_slot *slot,
 static int __init pci_hotplug_init (void)
 {
        int result;
+       struct kset *pci_bus_kset;
+
+       pci_bus_kset = bus_get_kset(&pci_bus_type);
 
        pci_hotplug_slots_kset = kset_create_and_add("slots", NULL,
-                                                    &pci_bus_type.subsys.kobj);
+                                                    &pci_bus_kset->kobj);
        if (!pci_hotplug_slots_kset) {
                result = -ENOMEM;
                err("Register subsys error\n");
index 313e0b32bc09bd52f8250e0a00ad2b7fa2a20f96..3cc13c32314ab0191423ecf869f50558a43fb099 100644 (file)
@@ -117,6 +117,8 @@ extern int bus_unregister_notifier(struct bus_type *bus,
 #define BUS_NOTIFY_UNBIND_DRIVER       0x00000004 /* driver about to be
                                                      unbound */
 
+extern struct kset *bus_get_kset(struct bus_type *bus);
+
 struct device_driver {
        const char              * name;
        struct bus_type         * bus;