summaryrefslogtreecommitdiffstats
path: root/kernel/params.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2007-12-18 07:05:35 +0100
committerGreg Kroah-Hartman <gregkh@suse.de>2008-01-25 05:40:31 +0100
commite43b9192c59402685bd1f809068dd13aa5931570 (patch)
treee274bbe6234692fa8bd6f09562be6bac8f9dcdac /kernel/params.c
parentKobject: convert fs/char_dev.c to use kobject_init/add_ng() (diff)
downloadlinux-e43b9192c59402685bd1f809068dd13aa5931570.tar.xz
linux-e43b9192c59402685bd1f809068dd13aa5931570.zip
Kobject: convert kernel/params.c to use kobject_init/add_ng()
This converts the code to use the new kobject functions, cleaning up the logic in doing so. Cc: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'kernel/params.c')
-rw-r--r--kernel/params.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/kernel/params.c b/kernel/params.c
index 97e092312155..1078b148ca80 100644
--- a/kernel/params.c
+++ b/kernel/params.c
@@ -561,11 +561,9 @@ static void __init kernel_param_sysfs_setup(const char *name,
mk->mod = THIS_MODULE;
mk->kobj.kset = module_kset;
- mk->kobj.ktype = &module_ktype;
- kobject_set_name(&mk->kobj, name);
- kobject_init(&mk->kobj);
- ret = kobject_add(&mk->kobj);
+ ret = kobject_init_and_add(&mk->kobj, &module_ktype, NULL, "%s", name);
if (ret) {
+ kobject_put(&mk->kobj);
printk(KERN_ERR "Module '%s' failed to be added to sysfs, "
"error number %d\n", name, ret);
printk(KERN_ERR "The system will be unstable now.\n");