aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/params.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/params.c')
-rw-r--r--kernel/params.c29
1 files changed, 9 insertions, 20 deletions
diff --git a/kernel/params.c b/kernel/params.c
index 9f051824097d..97e092312155 100644
--- a/kernel/params.c
+++ b/kernel/params.c
@@ -30,8 +30,6 @@
30#define DEBUGP(fmt, a...) 30#define DEBUGP(fmt, a...)
31#endif 31#endif
32 32
33static struct kobj_type module_ktype;
34
35static inline char dash2underscore(char c) 33static inline char dash2underscore(char c)
36{ 34{
37 if (c == '-') 35 if (c == '-')
@@ -562,7 +560,7 @@ static void __init kernel_param_sysfs_setup(const char *name,
562 BUG_ON(!mk); 560 BUG_ON(!mk);
563 561
564 mk->mod = THIS_MODULE; 562 mk->mod = THIS_MODULE;
565 mk->kobj.kset = &module_subsys; 563 mk->kobj.kset = module_kset;
566 mk->kobj.ktype = &module_ktype; 564 mk->kobj.ktype = &module_ktype;
567 kobject_set_name(&mk->kobj, name); 565 kobject_set_name(&mk->kobj, name);
568 kobject_init(&mk->kobj); 566 kobject_init(&mk->kobj);
@@ -695,7 +693,7 @@ static struct kset_uevent_ops module_uevent_ops = {
695 .filter = uevent_filter, 693 .filter = uevent_filter,
696}; 694};
697 695
698decl_subsys(module, &module_uevent_ops); 696struct kset *module_kset;
699int module_sysfs_initialized; 697int module_sysfs_initialized;
700 698
701static void module_release(struct kobject *kobj) 699static void module_release(struct kobject *kobj)
@@ -707,7 +705,7 @@ static void module_release(struct kobject *kobj)
707 */ 705 */
708} 706}
709 707
710static struct kobj_type module_ktype = { 708struct kobj_type module_ktype = {
711 .sysfs_ops = &module_sysfs_ops, 709 .sysfs_ops = &module_sysfs_ops,
712 .release = module_release, 710 .release = module_release,
713}; 711};
@@ -717,13 +715,11 @@ static struct kobj_type module_ktype = {
717 */ 715 */
718static int __init param_sysfs_init(void) 716static int __init param_sysfs_init(void)
719{ 717{
720 int ret; 718 module_kset = kset_create_and_add("module", &module_uevent_ops, NULL);
721 719 if (!module_kset) {
722 ret = subsystem_register(&module_subsys); 720 printk(KERN_WARNING "%s (%d): error creating kset\n",
723 if (ret < 0) { 721 __FILE__, __LINE__);
724 printk(KERN_WARNING "%s (%d): subsystem_register error: %d\n", 722 return -ENOMEM;
725 __FILE__, __LINE__, ret);
726 return ret;
727 } 723 }
728 module_sysfs_initialized = 1; 724 module_sysfs_initialized = 1;
729 725
@@ -733,14 +729,7 @@ static int __init param_sysfs_init(void)
733} 729}
734subsys_initcall(param_sysfs_init); 730subsys_initcall(param_sysfs_init);
735 731
736#else 732#endif /* CONFIG_SYSFS */
737#if 0
738static struct sysfs_ops module_sysfs_ops = {
739 .show = NULL,
740 .store = NULL,
741};
742#endif
743#endif
744 733
745EXPORT_SYMBOL(param_set_byte); 734EXPORT_SYMBOL(param_set_byte);
746EXPORT_SYMBOL(param_get_byte); 735EXPORT_SYMBOL(param_get_byte);