aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base/class.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2007-10-16 12:11:44 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2008-01-24 23:40:10 -0500
commit3514faca19a6fdc209734431c509631ea92b094e (patch)
treef6d102e6dec276f8e8d1044b47c74a02b901554f /drivers/base/class.c
parentc11c4154e7ff4cebfadad849b1e22689d759c3f4 (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/class.c')
-rw-r--r--drivers/base/class.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/base/class.c b/drivers/base/class.c
index a863bb091e1..8ad98924cdd 100644
--- a/drivers/base/class.c
+++ b/drivers/base/class.c
@@ -71,7 +71,7 @@ static struct kobj_type class_ktype = {
71}; 71};
72 72
73/* Hotplug events for classes go to the class_obj subsys */ 73/* Hotplug events for classes go to the class_obj subsys */
74static decl_subsys(class, &class_ktype, NULL); 74static decl_subsys(class, NULL);
75 75
76 76
77int class_create_file(struct class * cls, const struct class_attribute * attr) 77int class_create_file(struct class * cls, const struct class_attribute * attr)
@@ -150,6 +150,7 @@ int class_register(struct class * cls)
150 return error; 150 return error;
151 151
152 cls->subsys.kobj.kset = &class_subsys; 152 cls->subsys.kobj.kset = &class_subsys;
153 cls->subsys.kobj.ktype = &class_ktype;
153 154
154 error = subsystem_register(&cls->subsys); 155 error = subsystem_register(&cls->subsys);
155 if (!error) { 156 if (!error) {
@@ -452,7 +453,7 @@ static struct kset_uevent_ops class_uevent_ops = {
452 .uevent = class_uevent, 453 .uevent = class_uevent,
453}; 454};
454 455
455static decl_subsys(class_obj, &class_device_ktype, &class_uevent_ops); 456static decl_subsys(class_obj, &class_uevent_ops);
456 457
457 458
458static int class_device_add_attrs(struct class_device * cd) 459static int class_device_add_attrs(struct class_device * cd)
@@ -537,7 +538,8 @@ static struct class_device_attribute class_uevent_attr =
537 538
538void class_device_initialize(struct class_device *class_dev) 539void class_device_initialize(struct class_device *class_dev)
539{ 540{
540 kobj_set_kset_s(class_dev, class_obj_subsys); 541 class_dev->kobj.kset = &class_obj_subsys;
542 class_dev->kobj.ktype = &class_device_ktype;
541 kobject_init(&class_dev->kobj); 543 kobject_init(&class_dev->kobj);
542 INIT_LIST_HEAD(&class_dev->node); 544 INIT_LIST_HEAD(&class_dev->node);
543} 545}