kobject: convert debugfs to use kobject_create
authorGreg Kroah-Hartman <gregkh@suse.de>
Mon, 29 Oct 2007 19:13:17 +0000 (20:13 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 25 Jan 2008 04:40:11 +0000 (20:40 -0800)
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>
fs/debugfs/inode.c

index f7f13516fc1a8e5f9fe1fa58c209039499223f5e..667214200b0318a877617c308d9d9cc9bf2c4727 100644 (file)
@@ -426,20 +426,19 @@ exit:
 }
 EXPORT_SYMBOL_GPL(debugfs_rename);
 
-static decl_subsys(debug, NULL);
+static struct kobject *debug_kobj;
 
 static int __init debugfs_init(void)
 {
        int retval;
 
-       debug_subsys.kobj.kset = &kernel_subsys;
-       retval = subsystem_register(&debug_subsys);
-       if (retval)
-               return retval;
+       debug_kobj = kobject_create_and_add("debug", &kernel_subsys.kobj);
+       if (!debug_kobj)
+               return -EINVAL;
 
        retval = register_filesystem(&debug_fs_type);
        if (retval)
-               subsystem_unregister(&debug_subsys);
+               kobject_unregister(debug_kobj);
        return retval;
 }
 
@@ -447,7 +446,7 @@ static void __exit debugfs_exit(void)
 {
        simple_release_fs(&debugfs_mount, &debugfs_mount_count);
        unregister_filesystem(&debug_fs_type);
-       subsystem_unregister(&debug_subsys);
+       kobject_unregister(debug_kobj);
 }
 
 core_initcall(debugfs_init);