1 /* Helpers for initial module or kernel cmdline parsing
2 Copyright (C) 2001 Rusty Russell.
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 #include <linux/kernel.h>
19 #include <linux/string.h>
20 #include <linux/errno.h>
21 #include <linux/module.h>
22 #include <linux/moduleparam.h>
23 #include <linux/device.h>
24 #include <linux/err.h>
25 #include <linux/slab.h>
26 #include <linux/ctype.h>
29 /* Protects all built-in parameters, modules use their own param_lock */
30 static DEFINE_MUTEX(param_lock);
32 /* Use the module's mutex, or if built-in use the built-in mutex */
34 #define KPARAM_MUTEX(mod) ((mod) ? &(mod)->param_lock : ¶m_lock)
36 #define KPARAM_MUTEX(mod) (¶m_lock)
39 static inline void check_kparam_locked(struct module *mod)
41 BUG_ON(!mutex_is_locked(KPARAM_MUTEX(mod)));
44 static inline void check_kparam_locked(struct module *mod)
47 #endif /* !CONFIG_SYSFS */
49 /* This just allows us to keep track of which parameters are kmalloced. */
50 struct kmalloced_param {
51 struct list_head list;
54 static LIST_HEAD(kmalloced_params);
55 static DEFINE_SPINLOCK(kmalloced_params_lock);
57 static void *kmalloc_parameter(unsigned int size)
59 struct kmalloced_param *p;
61 p = kmalloc(sizeof(*p) + size, GFP_KERNEL);
65 spin_lock(&kmalloced_params_lock);
66 list_add(&p->list, &kmalloced_params);
67 spin_unlock(&kmalloced_params_lock);
72 /* Does nothing if parameter wasn't kmalloced above. */
73 static void maybe_kfree_parameter(void *param)
75 struct kmalloced_param *p;
77 spin_lock(&kmalloced_params_lock);
78 list_for_each_entry(p, &kmalloced_params, list) {
79 if (p->val == param) {
85 spin_unlock(&kmalloced_params_lock);
88 static char dash2underscore(char c)
95 bool parameqn(const char *a, const char *b, size_t n)
99 for (i = 0; i < n; i++) {
100 if (dash2underscore(a[i]) != dash2underscore(b[i]))
106 bool parameq(const char *a, const char *b)
108 return parameqn(a, b, strlen(a)+1);
111 static void param_check_unsafe(const struct kernel_param *kp)
113 if (kp->flags & KERNEL_PARAM_FL_UNSAFE) {
114 pr_warn("Setting dangerous option %s - tainting kernel\n",
116 add_taint(TAINT_USER, LOCKDEP_STILL_OK);
120 static int parse_one(char *param,
123 const struct kernel_param *params,
127 int (*handle_unknown)(char *param, char *val,
134 for (i = 0; i < num_params; i++) {
135 if (parameq(param, params[i].name)) {
136 if (params[i].level < min_level
137 || params[i].level > max_level)
139 /* No one handled NULL, so do it here. */
141 !(params[i].ops->flags & KERNEL_PARAM_OPS_FL_NOARG))
143 pr_debug("handling %s with %p\n", param,
145 kernel_param_lock(params[i].mod);
146 param_check_unsafe(¶ms[i]);
147 err = params[i].ops->set(val, ¶ms[i]);
148 kernel_param_unlock(params[i].mod);
153 if (handle_unknown) {
154 pr_debug("doing %s: %s='%s'\n", doing, param, val);
155 return handle_unknown(param, val, doing);
158 pr_debug("Unknown argument '%s'\n", param);
162 /* You can use " around spaces, but can't escape ". */
163 /* Hyphens and underscores equivalent in parameter names. */
164 static char *next_arg(char *args, char **param, char **val)
166 unsigned int i, equals = 0;
167 int in_quote = 0, quoted = 0;
176 for (i = 0; args[i]; i++) {
177 if (isspace(args[i]) && !in_quote)
184 in_quote = !in_quote;
192 *val = args + equals + 1;
194 /* Don't include quotes in value. */
197 if (args[i-1] == '"')
201 if (quoted && args[i-1] == '"')
210 /* Chew up trailing spaces. */
211 return skip_spaces(next);
214 /* Args looks like "foo=bar,bar2 baz=fuz wiz". */
215 char *parse_args(const char *doing,
217 const struct kernel_param *params,
221 int (*unknown)(char *param, char *val, const char *doing))
225 /* Chew leading spaces */
226 args = skip_spaces(args);
229 pr_debug("doing %s, parsing ARGS: '%s'\n", doing, args);
233 int irq_was_disabled;
235 args = next_arg(args, ¶m, &val);
237 if (!val && strcmp(param, "--") == 0)
239 irq_was_disabled = irqs_disabled();
240 ret = parse_one(param, val, doing, params, num,
241 min_level, max_level, unknown);
242 if (irq_was_disabled && !irqs_disabled())
243 pr_warn("%s: option '%s' enabled irq's!\n",
248 pr_err("%s: Unknown parameter `%s'\n", doing, param);
251 pr_err("%s: `%s' too large for parameter `%s'\n",
252 doing, val ?: "", param);
257 pr_err("%s: `%s' invalid for parameter `%s'\n",
258 doing, val ?: "", param);
267 /* Lazy bastard, eh? */
268 #define STANDARD_PARAM_DEF(name, type, format, strtolfn) \
269 int param_set_##name(const char *val, const struct kernel_param *kp) \
271 return strtolfn(val, 0, (type *)kp->arg); \
273 int param_get_##name(char *buffer, const struct kernel_param *kp) \
275 return scnprintf(buffer, PAGE_SIZE, format, \
276 *((type *)kp->arg)); \
278 const struct kernel_param_ops param_ops_##name = { \
279 .set = param_set_##name, \
280 .get = param_get_##name, \
282 EXPORT_SYMBOL(param_set_##name); \
283 EXPORT_SYMBOL(param_get_##name); \
284 EXPORT_SYMBOL(param_ops_##name)
287 STANDARD_PARAM_DEF(byte, unsigned char, "%hhu", kstrtou8);
288 STANDARD_PARAM_DEF(short, short, "%hi", kstrtos16);
289 STANDARD_PARAM_DEF(ushort, unsigned short, "%hu", kstrtou16);
290 STANDARD_PARAM_DEF(int, int, "%i", kstrtoint);
291 STANDARD_PARAM_DEF(uint, unsigned int, "%u", kstrtouint);
292 STANDARD_PARAM_DEF(long, long, "%li", kstrtol);
293 STANDARD_PARAM_DEF(ulong, unsigned long, "%lu", kstrtoul);
294 STANDARD_PARAM_DEF(ullong, unsigned long long, "%llu", kstrtoull);
296 int param_set_charp(const char *val, const struct kernel_param *kp)
298 if (strlen(val) > 1024) {
299 pr_err("%s: string parameter too long\n", kp->name);
303 maybe_kfree_parameter(*(char **)kp->arg);
305 /* This is a hack. We can't kmalloc in early boot, and we
306 * don't need to; this mangled commandline is preserved. */
307 if (slab_is_available()) {
308 *(char **)kp->arg = kmalloc_parameter(strlen(val)+1);
309 if (!*(char **)kp->arg)
311 strcpy(*(char **)kp->arg, val);
313 *(const char **)kp->arg = val;
317 EXPORT_SYMBOL(param_set_charp);
319 int param_get_charp(char *buffer, const struct kernel_param *kp)
321 return scnprintf(buffer, PAGE_SIZE, "%s", *((char **)kp->arg));
323 EXPORT_SYMBOL(param_get_charp);
325 static void param_free_charp(void *arg)
327 maybe_kfree_parameter(*((char **)arg));
330 const struct kernel_param_ops param_ops_charp = {
331 .set = param_set_charp,
332 .get = param_get_charp,
333 .free = param_free_charp,
335 EXPORT_SYMBOL(param_ops_charp);
337 /* Actually could be a bool or an int, for historical reasons. */
338 int param_set_bool(const char *val, const struct kernel_param *kp)
340 /* No equals means "set"... */
343 /* One of =[yYnN01] */
344 return strtobool(val, kp->arg);
346 EXPORT_SYMBOL(param_set_bool);
348 int param_get_bool(char *buffer, const struct kernel_param *kp)
350 /* Y and N chosen as being relatively non-coder friendly */
351 return sprintf(buffer, "%c", *(bool *)kp->arg ? 'Y' : 'N');
353 EXPORT_SYMBOL(param_get_bool);
355 const struct kernel_param_ops param_ops_bool = {
356 .flags = KERNEL_PARAM_OPS_FL_NOARG,
357 .set = param_set_bool,
358 .get = param_get_bool,
360 EXPORT_SYMBOL(param_ops_bool);
362 int param_set_bool_enable_only(const char *val, const struct kernel_param *kp)
366 bool orig_value = *(bool *)kp->arg;
367 struct kernel_param dummy_kp = *kp;
369 dummy_kp.arg = &new_value;
371 err = param_set_bool(val, &dummy_kp);
375 /* Don't let them unset it once it's set! */
376 if (!new_value && orig_value)
380 err = param_set_bool(val, kp);
384 EXPORT_SYMBOL_GPL(param_set_bool_enable_only);
386 const struct kernel_param_ops param_ops_bool_enable_only = {
387 .flags = KERNEL_PARAM_OPS_FL_NOARG,
388 .set = param_set_bool_enable_only,
389 .get = param_get_bool,
391 EXPORT_SYMBOL_GPL(param_ops_bool_enable_only);
393 /* This one must be bool. */
394 int param_set_invbool(const char *val, const struct kernel_param *kp)
398 struct kernel_param dummy;
400 dummy.arg = &boolval;
401 ret = param_set_bool(val, &dummy);
403 *(bool *)kp->arg = !boolval;
406 EXPORT_SYMBOL(param_set_invbool);
408 int param_get_invbool(char *buffer, const struct kernel_param *kp)
410 return sprintf(buffer, "%c", (*(bool *)kp->arg) ? 'N' : 'Y');
412 EXPORT_SYMBOL(param_get_invbool);
414 const struct kernel_param_ops param_ops_invbool = {
415 .set = param_set_invbool,
416 .get = param_get_invbool,
418 EXPORT_SYMBOL(param_ops_invbool);
420 int param_set_bint(const char *val, const struct kernel_param *kp)
422 /* Match bool exactly, by re-using it. */
423 struct kernel_param boolkp = *kp;
429 ret = param_set_bool(val, &boolkp);
434 EXPORT_SYMBOL(param_set_bint);
436 const struct kernel_param_ops param_ops_bint = {
437 .flags = KERNEL_PARAM_OPS_FL_NOARG,
438 .set = param_set_bint,
439 .get = param_get_int,
441 EXPORT_SYMBOL(param_ops_bint);
443 /* We break the rule and mangle the string. */
444 static int param_array(struct module *mod,
447 unsigned int min, unsigned int max,
448 void *elem, int elemsize,
449 int (*set)(const char *, const struct kernel_param *kp),
454 struct kernel_param kp;
457 /* Get the name right for errors. */
463 /* We expect a comma-separated list of values. */
468 pr_err("%s: can only take %i arguments\n", name, max);
471 len = strcspn(val, ",");
473 /* nul-terminate and parse */
475 ((char *)val)[len] = '\0';
476 check_kparam_locked(mod);
484 } while (save == ',');
487 pr_err("%s: needs at least %i arguments\n", name, min);
493 static int param_array_set(const char *val, const struct kernel_param *kp)
495 const struct kparam_array *arr = kp->arr;
496 unsigned int temp_num;
498 return param_array(kp->mod, kp->name, val, 1, arr->max, arr->elem,
499 arr->elemsize, arr->ops->set, kp->level,
500 arr->num ?: &temp_num);
503 static int param_array_get(char *buffer, const struct kernel_param *kp)
506 const struct kparam_array *arr = kp->arr;
507 struct kernel_param p = *kp;
509 for (i = off = 0; i < (arr->num ? *arr->num : arr->max); i++) {
512 p.arg = arr->elem + arr->elemsize * i;
513 check_kparam_locked(p.mod);
514 ret = arr->ops->get(buffer + off, &p);
523 static void param_array_free(void *arg)
526 const struct kparam_array *arr = arg;
529 for (i = 0; i < (arr->num ? *arr->num : arr->max); i++)
530 arr->ops->free(arr->elem + arr->elemsize * i);
533 const struct kernel_param_ops param_array_ops = {
534 .set = param_array_set,
535 .get = param_array_get,
536 .free = param_array_free,
538 EXPORT_SYMBOL(param_array_ops);
540 int param_set_copystring(const char *val, const struct kernel_param *kp)
542 const struct kparam_string *kps = kp->str;
544 if (strlen(val)+1 > kps->maxlen) {
545 pr_err("%s: string doesn't fit in %u chars.\n",
546 kp->name, kps->maxlen-1);
549 strcpy(kps->string, val);
552 EXPORT_SYMBOL(param_set_copystring);
554 int param_get_string(char *buffer, const struct kernel_param *kp)
556 const struct kparam_string *kps = kp->str;
557 return strlcpy(buffer, kps->string, kps->maxlen);
559 EXPORT_SYMBOL(param_get_string);
561 const struct kernel_param_ops param_ops_string = {
562 .set = param_set_copystring,
563 .get = param_get_string,
565 EXPORT_SYMBOL(param_ops_string);
567 /* sysfs output in /sys/modules/XYZ/parameters/ */
568 #define to_module_attr(n) container_of(n, struct module_attribute, attr)
569 #define to_module_kobject(n) container_of(n, struct module_kobject, kobj)
571 struct param_attribute
573 struct module_attribute mattr;
574 const struct kernel_param *param;
577 struct module_param_attrs
580 struct attribute_group grp;
581 struct param_attribute attrs[0];
585 #define to_param_attr(n) container_of(n, struct param_attribute, mattr)
587 static ssize_t param_attr_show(struct module_attribute *mattr,
588 struct module_kobject *mk, char *buf)
591 struct param_attribute *attribute = to_param_attr(mattr);
593 if (!attribute->param->ops->get)
596 kernel_param_lock(mk->mod);
597 count = attribute->param->ops->get(buf, attribute->param);
598 kernel_param_unlock(mk->mod);
606 /* sysfs always hands a nul-terminated string in buf. We rely on that. */
607 static ssize_t param_attr_store(struct module_attribute *mattr,
608 struct module_kobject *mk,
609 const char *buf, size_t len)
612 struct param_attribute *attribute = to_param_attr(mattr);
614 if (!attribute->param->ops->set)
617 kernel_param_lock(mk->mod);
618 param_check_unsafe(attribute->param);
619 err = attribute->param->ops->set(buf, attribute->param);
620 kernel_param_unlock(mk->mod);
627 #ifdef CONFIG_MODULES
630 #define __modinit __init
634 void kernel_param_lock(struct module *mod)
636 mutex_lock(KPARAM_MUTEX(mod));
639 void kernel_param_unlock(struct module *mod)
641 mutex_unlock(KPARAM_MUTEX(mod));
644 EXPORT_SYMBOL(kernel_param_lock);
645 EXPORT_SYMBOL(kernel_param_unlock);
648 * add_sysfs_param - add a parameter to sysfs
649 * @mk: struct module_kobject
650 * @kparam: the actual parameter definition to add to sysfs
651 * @name: name of parameter
653 * Create a kobject if for a (per-module) parameter if mp NULL, and
654 * create file in sysfs. Returns an error on out of memory. Always cleans up
655 * if there's an error.
657 static __modinit int add_sysfs_param(struct module_kobject *mk,
658 const struct kernel_param *kp,
661 struct module_param_attrs *new_mp;
662 struct attribute **new_attrs;
665 /* We don't bother calling this with invisible parameters. */
669 /* First allocation. */
670 mk->mp = kzalloc(sizeof(*mk->mp), GFP_KERNEL);
673 mk->mp->grp.name = "parameters";
674 /* NULL-terminated attribute array. */
675 mk->mp->grp.attrs = kzalloc(sizeof(mk->mp->grp.attrs[0]),
677 /* Caller will cleanup via free_module_param_attrs */
678 if (!mk->mp->grp.attrs)
682 /* Enlarge allocations. */
683 new_mp = krealloc(mk->mp,
685 sizeof(mk->mp->attrs[0]) * (mk->mp->num + 1),
691 /* Extra pointer for NULL terminator */
692 new_attrs = krealloc(mk->mp->grp.attrs,
693 sizeof(mk->mp->grp.attrs[0]) * (mk->mp->num + 2),
697 mk->mp->grp.attrs = new_attrs;
699 /* Tack new one on the end. */
700 memset(&mk->mp->attrs[mk->mp->num], 0, sizeof(mk->mp->attrs[0]));
701 sysfs_attr_init(&mk->mp->attrs[mk->mp->num].mattr.attr);
702 mk->mp->attrs[mk->mp->num].param = kp;
703 mk->mp->attrs[mk->mp->num].mattr.show = param_attr_show;
704 /* Do not allow runtime DAC changes to make param writable. */
705 if ((kp->perm & (S_IWUSR | S_IWGRP | S_IWOTH)) != 0)
706 mk->mp->attrs[mk->mp->num].mattr.store = param_attr_store;
708 mk->mp->attrs[mk->mp->num].mattr.store = NULL;
709 mk->mp->attrs[mk->mp->num].mattr.attr.name = (char *)name;
710 mk->mp->attrs[mk->mp->num].mattr.attr.mode = kp->perm;
713 /* Fix up all the pointers, since krealloc can move us */
714 for (i = 0; i < mk->mp->num; i++)
715 mk->mp->grp.attrs[i] = &mk->mp->attrs[i].mattr.attr;
716 mk->mp->grp.attrs[mk->mp->num] = NULL;
720 #ifdef CONFIG_MODULES
721 static void free_module_param_attrs(struct module_kobject *mk)
724 kfree(mk->mp->grp.attrs);
730 * module_param_sysfs_setup - setup sysfs support for one module
732 * @kparam: module parameters (array)
733 * @num_params: number of module parameters
735 * Adds sysfs entries for module parameters under
736 * /sys/module/[mod->name]/parameters/
738 int module_param_sysfs_setup(struct module *mod,
739 const struct kernel_param *kparam,
740 unsigned int num_params)
745 for (i = 0; i < num_params; i++) {
746 if (kparam[i].perm == 0)
748 err = add_sysfs_param(&mod->mkobj, &kparam[i], kparam[i].name);
750 free_module_param_attrs(&mod->mkobj);
759 /* Create the param group. */
760 err = sysfs_create_group(&mod->mkobj.kobj, &mod->mkobj.mp->grp);
762 free_module_param_attrs(&mod->mkobj);
767 * module_param_sysfs_remove - remove sysfs support for one module
770 * Remove sysfs entries for module parameters and the corresponding
773 void module_param_sysfs_remove(struct module *mod)
776 sysfs_remove_group(&mod->mkobj.kobj, &mod->mkobj.mp->grp);
777 /* We are positive that no one is using any param
778 * attrs at this point. Deallocate immediately. */
779 free_module_param_attrs(&mod->mkobj);
784 void destroy_params(const struct kernel_param *params, unsigned num)
788 for (i = 0; i < num; i++)
789 if (params[i].ops->free)
790 params[i].ops->free(params[i].arg);
793 static struct module_kobject * __init locate_module_kobject(const char *name)
795 struct module_kobject *mk;
796 struct kobject *kobj;
799 kobj = kset_find_obj(module_kset, name);
801 mk = to_module_kobject(kobj);
803 mk = kzalloc(sizeof(struct module_kobject), GFP_KERNEL);
806 mk->mod = THIS_MODULE;
807 mk->kobj.kset = module_kset;
808 err = kobject_init_and_add(&mk->kobj, &module_ktype, NULL,
810 #ifdef CONFIG_MODULES
812 err = sysfs_create_file(&mk->kobj, &module_uevent.attr);
815 kobject_put(&mk->kobj);
816 pr_crit("Adding module '%s' to sysfs failed (%d), the system may be unstable.\n",
821 /* So that we hold reference in both cases. */
822 kobject_get(&mk->kobj);
828 static void __init kernel_add_sysfs_param(const char *name,
829 const struct kernel_param *kparam,
830 unsigned int name_skip)
832 struct module_kobject *mk;
835 mk = locate_module_kobject(name);
839 /* We need to remove old parameters before adding more. */
841 sysfs_remove_group(&mk->kobj, &mk->mp->grp);
843 /* These should not fail at boot. */
844 err = add_sysfs_param(mk, kparam, kparam->name + name_skip);
846 err = sysfs_create_group(&mk->kobj, &mk->mp->grp);
848 kobject_uevent(&mk->kobj, KOBJ_ADD);
849 kobject_put(&mk->kobj);
853 * param_sysfs_builtin - add sysfs parameters for built-in modules
855 * Add module_parameters to sysfs for "modules" built into the kernel.
857 * The "module" name (KBUILD_MODNAME) is stored before a dot, the
858 * "parameter" name is stored behind a dot in kernel_param->name. So,
859 * extract the "module" name for all built-in kernel_param-eters,
860 * and for all who have the same, call kernel_add_sysfs_param.
862 static void __init param_sysfs_builtin(void)
864 const struct kernel_param *kp;
865 unsigned int name_len;
866 char modname[MODULE_NAME_LEN];
868 for (kp = __start___param; kp < __stop___param; kp++) {
874 dot = strchr(kp->name, '.');
876 /* This happens for core_param() */
877 strcpy(modname, "kernel");
880 name_len = dot - kp->name + 1;
881 strlcpy(modname, kp->name, name_len);
883 kernel_add_sysfs_param(modname, kp, name_len);
887 ssize_t __modver_version_show(struct module_attribute *mattr,
888 struct module_kobject *mk, char *buf)
890 struct module_version_attribute *vattr =
891 container_of(mattr, struct module_version_attribute, mattr);
893 return scnprintf(buf, PAGE_SIZE, "%s\n", vattr->version);
896 extern const struct module_version_attribute *__start___modver[];
897 extern const struct module_version_attribute *__stop___modver[];
899 static void __init version_sysfs_builtin(void)
901 const struct module_version_attribute **p;
902 struct module_kobject *mk;
905 for (p = __start___modver; p < __stop___modver; p++) {
906 const struct module_version_attribute *vattr = *p;
908 mk = locate_module_kobject(vattr->module_name);
910 err = sysfs_create_file(&mk->kobj, &vattr->mattr.attr);
912 kobject_uevent(&mk->kobj, KOBJ_ADD);
913 kobject_put(&mk->kobj);
918 /* module-related sysfs stuff */
920 static ssize_t module_attr_show(struct kobject *kobj,
921 struct attribute *attr,
924 struct module_attribute *attribute;
925 struct module_kobject *mk;
928 attribute = to_module_attr(attr);
929 mk = to_module_kobject(kobj);
931 if (!attribute->show)
934 ret = attribute->show(attribute, mk, buf);
939 static ssize_t module_attr_store(struct kobject *kobj,
940 struct attribute *attr,
941 const char *buf, size_t len)
943 struct module_attribute *attribute;
944 struct module_kobject *mk;
947 attribute = to_module_attr(attr);
948 mk = to_module_kobject(kobj);
950 if (!attribute->store)
953 ret = attribute->store(attribute, mk, buf, len);
958 static const struct sysfs_ops module_sysfs_ops = {
959 .show = module_attr_show,
960 .store = module_attr_store,
963 static int uevent_filter(struct kset *kset, struct kobject *kobj)
965 struct kobj_type *ktype = get_ktype(kobj);
967 if (ktype == &module_ktype)
972 static const struct kset_uevent_ops module_uevent_ops = {
973 .filter = uevent_filter,
976 struct kset *module_kset;
977 int module_sysfs_initialized;
979 static void module_kobj_release(struct kobject *kobj)
981 struct module_kobject *mk = to_module_kobject(kobj);
982 complete(mk->kobj_completion);
985 struct kobj_type module_ktype = {
986 .release = module_kobj_release,
987 .sysfs_ops = &module_sysfs_ops,
991 * param_sysfs_init - wrapper for built-in params support
993 static int __init param_sysfs_init(void)
995 module_kset = kset_create_and_add("module", &module_uevent_ops, NULL);
997 printk(KERN_WARNING "%s (%d): error creating kset\n",
1001 module_sysfs_initialized = 1;
1003 version_sysfs_builtin();
1004 param_sysfs_builtin();
1008 subsys_initcall(param_sysfs_init);
1010 #endif /* CONFIG_SYSFS */