aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/params.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/params.c')
-rw-r--r--kernel/params.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/kernel/params.c b/kernel/params.c
index 718945da8f58..737b7c5e93aa 100644
--- a/kernel/params.c
+++ b/kernel/params.c
@@ -561,14 +561,12 @@ static void __init kernel_param_sysfs_setup(const char *name,
561 mk->mod = THIS_MODULE; 561 mk->mod = THIS_MODULE;
562 kobj_set_kset_s(mk, module_subsys); 562 kobj_set_kset_s(mk, module_subsys);
563 kobject_set_name(&mk->kobj, name); 563 kobject_set_name(&mk->kobj, name);
564 ret = kobject_register(&mk->kobj); 564 kobject_init(&mk->kobj);
565 ret = kobject_add(&mk->kobj);
565 BUG_ON(ret < 0); 566 BUG_ON(ret < 0);
566 567 param_sysfs_setup(mk, kparam, num_params, name_skip);
567 /* no need to keep the kobject if no parameter is exported */ 568 mk->drivers_dir = kobject_add_dir(&mk->kobj, "drivers");
568 if (!param_sysfs_setup(mk, kparam, num_params, name_skip)) { 569 kobject_uevent(&mk->kobj, KOBJ_ADD);
569 kobject_unregister(&mk->kobj);
570 kfree(mk);
571 }
572} 570}
573 571
574/* 572/*