提交 443dbf90 编写于 作者: G Greg Kroah-Hartman

kset: convert drivers/base/class.c to use kset_create

Dynamically create the kset instead of declaring it statically.

The class_obj subsystem is not yet converted as it is more complex and
should be going away soon with the removal of class_device from the
kernel tree.

Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 59a54833
...@@ -71,7 +71,7 @@ static struct kobj_type class_ktype = { ...@@ -71,7 +71,7 @@ static struct kobj_type class_ktype = {
}; };
/* Hotplug events for classes go to the class_obj subsys */ /* Hotplug events for classes go to the class_obj subsys */
static decl_subsys(class, NULL); static struct kset *class_kset;
int class_create_file(struct class * cls, const struct class_attribute * attr) int class_create_file(struct class * cls, const struct class_attribute * attr)
...@@ -149,7 +149,7 @@ int class_register(struct class * cls) ...@@ -149,7 +149,7 @@ int class_register(struct class * cls)
if (error) if (error)
return error; return error;
cls->subsys.kobj.kset = &class_subsys; cls->subsys.kobj.kset = class_kset;
cls->subsys.kobj.ktype = &class_ktype; cls->subsys.kobj.ktype = &class_ktype;
error = subsystem_register(&cls->subsys); error = subsystem_register(&cls->subsys);
...@@ -855,11 +855,9 @@ void class_interface_unregister(struct class_interface *class_intf) ...@@ -855,11 +855,9 @@ void class_interface_unregister(struct class_interface *class_intf)
int __init classes_init(void) int __init classes_init(void)
{ {
int retval; class_kset = kset_create_and_add("class", NULL, NULL);
if (!class_kset)
retval = subsystem_register(&class_subsys); return -ENOMEM;
if (retval)
return retval;
/* ick, this is ugly, the things we go through to keep from showing up /* ick, this is ugly, the things we go through to keep from showing up
* in sysfs... */ * in sysfs... */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册