diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2007-10-16 12:11:44 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2008-01-24 23:40:10 -0500 |
commit | 3514faca19a6fdc209734431c509631ea92b094e (patch) | |
tree | f6d102e6dec276f8e8d1044b47c74a02b901554f /drivers/base/bus.c | |
parent | c11c4154e7ff4cebfadad849b1e22689d759c3f4 (diff) |
kobject: remove struct kobj_type from struct kset
We don't need a "default" ktype for a kset. We should set this
explicitly every time for each kset. This change is needed so that we
can make ksets dynamic, and cleans up one of the odd, undocumented
assumption that the kset/kobject/ktype model has.
This patch is based on a lot of help from Kay Sievers.
Nasty bug in the block code was found by Dave Young
<hidave.darkstar@gmail.com>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Cc: Dave Young <hidave.darkstar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/base/bus.c')
-rw-r--r-- | drivers/base/bus.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/base/bus.c b/drivers/base/bus.c index 9a19b071c573..630956037e18 100644 --- a/drivers/base/bus.c +++ b/drivers/base/bus.c | |||
@@ -166,7 +166,7 @@ static struct kset_uevent_ops bus_uevent_ops = { | |||
166 | .filter = bus_uevent_filter, | 166 | .filter = bus_uevent_filter, |
167 | }; | 167 | }; |
168 | 168 | ||
169 | static decl_subsys(bus, &bus_ktype, &bus_uevent_ops); | 169 | static decl_subsys(bus, &bus_uevent_ops); |
170 | 170 | ||
171 | 171 | ||
172 | #ifdef CONFIG_HOTPLUG | 172 | #ifdef CONFIG_HOTPLUG |
@@ -639,6 +639,7 @@ int bus_add_driver(struct device_driver *drv) | |||
639 | if (error) | 639 | if (error) |
640 | goto out_put_bus; | 640 | goto out_put_bus; |
641 | drv->kobj.kset = &bus->drivers; | 641 | drv->kobj.kset = &bus->drivers; |
642 | drv->kobj.ktype = &driver_ktype; | ||
642 | error = kobject_register(&drv->kobj); | 643 | error = kobject_register(&drv->kobj); |
643 | if (error) | 644 | if (error) |
644 | goto out_put_bus; | 645 | goto out_put_bus; |
@@ -851,6 +852,7 @@ int bus_register(struct bus_type * bus) | |||
851 | goto out; | 852 | goto out; |
852 | 853 | ||
853 | bus->subsys.kobj.kset = &bus_subsys; | 854 | bus->subsys.kobj.kset = &bus_subsys; |
855 | bus->subsys.kobj.ktype = &bus_ktype; | ||
854 | 856 | ||
855 | retval = subsystem_register(&bus->subsys); | 857 | retval = subsystem_register(&bus->subsys); |
856 | if (retval) | 858 | if (retval) |
@@ -868,7 +870,6 @@ int bus_register(struct bus_type * bus) | |||
868 | 870 | ||
869 | kobject_set_name(&bus->drivers.kobj, "drivers"); | 871 | kobject_set_name(&bus->drivers.kobj, "drivers"); |
870 | bus->drivers.kobj.parent = &bus->subsys.kobj; | 872 | bus->drivers.kobj.parent = &bus->subsys.kobj; |
871 | bus->drivers.ktype = &driver_ktype; | ||
872 | retval = kset_register(&bus->drivers); | 873 | retval = kset_register(&bus->drivers); |
873 | if (retval) | 874 | if (retval) |
874 | goto bus_drivers_fail; | 875 | goto bus_drivers_fail; |