Commit 6e90aa97 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

kobject: convert ecryptfs to use kobject_create

Using a kset for this trivial directory is an overkill.

Cc: Kay Sievers <kay.sievers@vrfy.org>
Cc: Mike Halcrow <mhalcrow@us.ibm.com>
Cc: Phillip Hellewell <phillip@hellewell.homeip.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent f55842f2
...@@ -734,7 +734,7 @@ static int ecryptfs_init_kmem_caches(void) ...@@ -734,7 +734,7 @@ static int ecryptfs_init_kmem_caches(void)
return 0; return 0;
} }
static struct kset *ecryptfs_kset; static struct kobject *ecryptfs_kobj;
static ssize_t version_show(struct kobject *kobj, static ssize_t version_show(struct kobject *kobj,
struct kobj_attribute *attr, char *buff) struct kobj_attribute *attr, char *buff)
...@@ -757,17 +757,17 @@ static int do_sysfs_registration(void) ...@@ -757,17 +757,17 @@ static int do_sysfs_registration(void)
{ {
int rc; int rc;
ecryptfs_kset = kset_create_and_add("ecryptfs", NULL, fs_kobj); ecryptfs_kobj = kobject_create_and_add("ecryptfs", fs_kobj);
if (!ecryptfs_kset) { if (!ecryptfs_kobj) {
printk(KERN_ERR "Unable to create ecryptfs kset\n"); printk(KERN_ERR "Unable to create ecryptfs kset\n");
rc = -ENOMEM; rc = -ENOMEM;
goto out; goto out;
} }
rc = sysfs_create_group(&ecryptfs_kset->kobj, &attr_group); rc = sysfs_create_group(ecryptfs_kobj, &attr_group);
if (rc) { if (rc) {
printk(KERN_ERR printk(KERN_ERR
"Unable to create ecryptfs version attributes\n"); "Unable to create ecryptfs version attributes\n");
kset_unregister(ecryptfs_kset); kobject_unregister(ecryptfs_kobj);
} }
out: out:
return rc; return rc;
...@@ -775,8 +775,8 @@ static int do_sysfs_registration(void) ...@@ -775,8 +775,8 @@ static int do_sysfs_registration(void)
static void do_sysfs_unregistration(void) static void do_sysfs_unregistration(void)
{ {
sysfs_remove_group(&ecryptfs_kset->kobj, &attr_group); sysfs_remove_group(ecryptfs_kobj, &attr_group);
kset_unregister(ecryptfs_kset); kobject_unregister(ecryptfs_kobj);
} }
static int __init ecryptfs_init(void) static int __init ecryptfs_init(void)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment