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>
This commit is contained in:
Greg Kroah-Hartman
2007-10-16 10:11:44 -06:00
parent c11c4154e7
commit 3514faca19
36 changed files with 84 additions and 87 deletions

View File

@ -405,7 +405,7 @@ static struct device_attribute devt_attr =
* devices_subsys - structure to be registered with kobject core.
*/
decl_subsys(devices, &device_ktype, &device_uevent_ops);
decl_subsys(devices, &device_uevent_ops);
/**
@ -525,7 +525,8 @@ static void klist_children_put(struct klist_node *n)
void device_initialize(struct device *dev)
{
kobj_set_kset_s(dev, devices_subsys);
dev->kobj.kset = &devices_subsys;
dev->kobj.ktype = &device_ktype;
kobject_init(&dev->kobj);
klist_init(&dev->klist_children, klist_children_get,
klist_children_put);