Commit e43b9192 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

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: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent a5815ddf
...@@ -561,11 +561,9 @@ static void __init kernel_param_sysfs_setup(const char *name, ...@@ -561,11 +561,9 @@ static void __init kernel_param_sysfs_setup(const char *name,
mk->mod = THIS_MODULE; mk->mod = THIS_MODULE;
mk->kobj.kset = module_kset; mk->kobj.kset = module_kset;
mk->kobj.ktype = &module_ktype; ret = kobject_init_and_add(&mk->kobj, &module_ktype, NULL, "%s", name);
kobject_set_name(&mk->kobj, name);
kobject_init(&mk->kobj);
ret = kobject_add(&mk->kobj);
if (ret) { if (ret) {
kobject_put(&mk->kobj);
printk(KERN_ERR "Module '%s' failed to be added to sysfs, " printk(KERN_ERR "Module '%s' failed to be added to sysfs, "
"error number %d\n", name, ret); "error number %d\n", name, ret);
printk(KERN_ERR "The system will be unstable now.\n"); printk(KERN_ERR "The system will be unstable now.\n");
......
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