kobject: convert securityfs 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>
Acked-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
security/inode.c

index 9e42f5f705b210a3c3a2b4e762385134ac565486..dfc5978d4298eafe66f1fbcf512ef9afe635132c 100644 (file)
@@ -315,20 +315,19 @@ void securityfs_remove(struct dentry *dentry)
 }
 EXPORT_SYMBOL_GPL(securityfs_remove);
 
-static decl_subsys(security, NULL);
+static struct kobject *security_kobj;
 
 static int __init securityfs_init(void)
 {
        int retval;
 
-       security_subsys.kobj.kset = &kernel_subsys;
-       retval = subsystem_register(&security_subsys);
-       if (retval)
-               return retval;
+       security_kobj = kobject_create_and_add("security", &kernel_subsys.kobj);
+       if (!security_kobj)
+               return -EINVAL;
 
        retval = register_filesystem(&fs_type);
        if (retval)
-               subsystem_unregister(&security_subsys);
+               kobject_unregister(security_kobj);
        return retval;
 }