diff options
Diffstat (limited to 'drivers/base/class.c')
-rw-r--r-- | drivers/base/class.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/drivers/base/class.c b/drivers/base/class.c index 8ad98924cddb..d8a92c650b43 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 */ |
74 | static decl_subsys(class, NULL); | 74 | static struct kset *class_kset; |
75 | 75 | ||
76 | 76 | ||
77 | int class_create_file(struct class * cls, const struct class_attribute * attr) | 77 | int class_create_file(struct class * cls, const struct class_attribute * attr) |
@@ -149,7 +149,7 @@ int class_register(struct class * cls) | |||
149 | if (error) | 149 | if (error) |
150 | return error; | 150 | return error; |
151 | 151 | ||
152 | cls->subsys.kobj.kset = &class_subsys; | 152 | cls->subsys.kobj.kset = class_kset; |
153 | cls->subsys.kobj.ktype = &class_ktype; | 153 | cls->subsys.kobj.ktype = &class_ktype; |
154 | 154 | ||
155 | error = subsystem_register(&cls->subsys); | 155 | error = subsystem_register(&cls->subsys); |
@@ -855,11 +855,9 @@ void class_interface_unregister(struct class_interface *class_intf) | |||
855 | 855 | ||
856 | int __init classes_init(void) | 856 | int __init classes_init(void) |
857 | { | 857 | { |
858 | int retval; | 858 | class_kset = kset_create_and_add("class", NULL, NULL); |
859 | 859 | if (!class_kset) | |
860 | retval = subsystem_register(&class_subsys); | 860 | return -ENOMEM; |
861 | if (retval) | ||
862 | return retval; | ||
863 | 861 | ||
864 | /* ick, this is ugly, the things we go through to keep from showing up | 862 | /* ick, this is ugly, the things we go through to keep from showing up |
865 | * in sysfs... */ | 863 | * in sysfs... */ |