kobject: convert debugfs to use kobject_create
We don't need a kset here, a simple kobject will do just fine, so dynamically create the kobject and use it. Cc: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
69d8e13895
commit
191e186bd0
|
@ -426,20 +426,19 @@ exit:
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(debugfs_rename);
|
EXPORT_SYMBOL_GPL(debugfs_rename);
|
||||||
|
|
||||||
static decl_subsys(debug, NULL);
|
static struct kobject *debug_kobj;
|
||||||
|
|
||||||
static int __init debugfs_init(void)
|
static int __init debugfs_init(void)
|
||||||
{
|
{
|
||||||
int retval;
|
int retval;
|
||||||
|
|
||||||
debug_subsys.kobj.kset = &kernel_subsys;
|
debug_kobj = kobject_create_and_add("debug", &kernel_subsys.kobj);
|
||||||
retval = subsystem_register(&debug_subsys);
|
if (!debug_kobj)
|
||||||
if (retval)
|
return -EINVAL;
|
||||||
return retval;
|
|
||||||
|
|
||||||
retval = register_filesystem(&debug_fs_type);
|
retval = register_filesystem(&debug_fs_type);
|
||||||
if (retval)
|
if (retval)
|
||||||
subsystem_unregister(&debug_subsys);
|
kobject_unregister(debug_kobj);
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -447,7 +446,7 @@ static void __exit debugfs_exit(void)
|
||||||
{
|
{
|
||||||
simple_release_fs(&debugfs_mount, &debugfs_mount_count);
|
simple_release_fs(&debugfs_mount, &debugfs_mount_count);
|
||||||
unregister_filesystem(&debug_fs_type);
|
unregister_filesystem(&debug_fs_type);
|
||||||
subsystem_unregister(&debug_subsys);
|
kobject_unregister(debug_kobj);
|
||||||
}
|
}
|
||||||
|
|
||||||
core_initcall(debugfs_init);
|
core_initcall(debugfs_init);
|
||||||
|
|
Loading…
Reference in a new issue