param: use free hook for charp (fix leak of charp parameters)
[linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git] / kernel / params.c
blobef60db14fae0f67eb1734ccbf1bd96abe86d63d7
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/moduleparam.h>
19 #include <linux/kernel.h>
20 #include <linux/string.h>
21 #include <linux/errno.h>
22 #include <linux/module.h>
23 #include <linux/device.h>
24 #include <linux/err.h>
25 #include <linux/slab.h>
26 #include <linux/ctype.h>
28 #if 0
29 #define DEBUGP printk
30 #else
31 #define DEBUGP(fmt, a...)
32 #endif
34 /* This just allows us to keep track of which parameters are kmalloced. */
35 struct kmalloced_param {
36 struct list_head list;
37 char val[];
39 static DEFINE_MUTEX(param_lock);
40 static LIST_HEAD(kmalloced_params);
42 static void *kmalloc_parameter(unsigned int size)
44 struct kmalloced_param *p;
46 p = kmalloc(sizeof(*p) + size, GFP_KERNEL);
47 if (!p)
48 return NULL;
50 mutex_lock(&param_lock);
51 list_add(&p->list, &kmalloced_params);
52 mutex_unlock(&param_lock);
54 return p->val;
57 /* Does nothing if parameter wasn't kmalloced above. */
58 static void maybe_kfree_parameter(void *param)
60 struct kmalloced_param *p;
62 mutex_lock(&param_lock);
63 list_for_each_entry(p, &kmalloced_params, list) {
64 if (p->val == param) {
65 list_del(&p->list);
66 kfree(p);
67 break;
70 mutex_unlock(&param_lock);
73 static inline char dash2underscore(char c)
75 if (c == '-')
76 return '_';
77 return c;
80 static inline int parameq(const char *input, const char *paramname)
82 unsigned int i;
83 for (i = 0; dash2underscore(input[i]) == paramname[i]; i++)
84 if (input[i] == '\0')
85 return 1;
86 return 0;
89 static int parse_one(char *param,
90 char *val,
91 struct kernel_param *params,
92 unsigned num_params,
93 int (*handle_unknown)(char *param, char *val))
95 unsigned int i;
97 /* Find parameter */
98 for (i = 0; i < num_params; i++) {
99 if (parameq(param, params[i].name)) {
100 /* Noone handled NULL, so do it here. */
101 if (!val && params[i].ops->set != param_set_bool)
102 return -EINVAL;
103 DEBUGP("They are equal! Calling %p\n",
104 params[i].ops->set);
105 return params[i].ops->set(val, &params[i]);
109 if (handle_unknown) {
110 DEBUGP("Unknown argument: calling %p\n", handle_unknown);
111 return handle_unknown(param, val);
114 DEBUGP("Unknown argument `%s'\n", param);
115 return -ENOENT;
118 /* You can use " around spaces, but can't escape ". */
119 /* Hyphens and underscores equivalent in parameter names. */
120 static char *next_arg(char *args, char **param, char **val)
122 unsigned int i, equals = 0;
123 int in_quote = 0, quoted = 0;
124 char *next;
126 if (*args == '"') {
127 args++;
128 in_quote = 1;
129 quoted = 1;
132 for (i = 0; args[i]; i++) {
133 if (isspace(args[i]) && !in_quote)
134 break;
135 if (equals == 0) {
136 if (args[i] == '=')
137 equals = i;
139 if (args[i] == '"')
140 in_quote = !in_quote;
143 *param = args;
144 if (!equals)
145 *val = NULL;
146 else {
147 args[equals] = '\0';
148 *val = args + equals + 1;
150 /* Don't include quotes in value. */
151 if (**val == '"') {
152 (*val)++;
153 if (args[i-1] == '"')
154 args[i-1] = '\0';
156 if (quoted && args[i-1] == '"')
157 args[i-1] = '\0';
160 if (args[i]) {
161 args[i] = '\0';
162 next = args + i + 1;
163 } else
164 next = args + i;
166 /* Chew up trailing spaces. */
167 return skip_spaces(next);
170 /* Args looks like "foo=bar,bar2 baz=fuz wiz". */
171 int parse_args(const char *name,
172 char *args,
173 struct kernel_param *params,
174 unsigned num,
175 int (*unknown)(char *param, char *val))
177 char *param, *val;
179 DEBUGP("Parsing ARGS: %s\n", args);
181 /* Chew leading spaces */
182 args = skip_spaces(args);
184 while (*args) {
185 int ret;
186 int irq_was_disabled;
188 args = next_arg(args, &param, &val);
189 irq_was_disabled = irqs_disabled();
190 ret = parse_one(param, val, params, num, unknown);
191 if (irq_was_disabled && !irqs_disabled()) {
192 printk(KERN_WARNING "parse_args(): option '%s' enabled "
193 "irq's!\n", param);
195 switch (ret) {
196 case -ENOENT:
197 printk(KERN_ERR "%s: Unknown parameter `%s'\n",
198 name, param);
199 return ret;
200 case -ENOSPC:
201 printk(KERN_ERR
202 "%s: `%s' too large for parameter `%s'\n",
203 name, val ?: "", param);
204 return ret;
205 case 0:
206 break;
207 default:
208 printk(KERN_ERR
209 "%s: `%s' invalid for parameter `%s'\n",
210 name, val ?: "", param);
211 return ret;
215 /* All parsed OK. */
216 return 0;
219 /* Lazy bastard, eh? */
220 #define STANDARD_PARAM_DEF(name, type, format, tmptype, strtolfn) \
221 int param_set_##name(const char *val, const struct kernel_param *kp) \
223 tmptype l; \
224 int ret; \
226 ret = strtolfn(val, 0, &l); \
227 if (ret == -EINVAL || ((type)l != l)) \
228 return -EINVAL; \
229 *((type *)kp->arg) = l; \
230 return 0; \
232 int param_get_##name(char *buffer, const struct kernel_param *kp) \
234 return sprintf(buffer, format, *((type *)kp->arg)); \
236 struct kernel_param_ops param_ops_##name = { \
237 .set = param_set_##name, \
238 .get = param_get_##name, \
239 }; \
240 EXPORT_SYMBOL(param_set_##name); \
241 EXPORT_SYMBOL(param_get_##name); \
242 EXPORT_SYMBOL(param_ops_##name)
245 STANDARD_PARAM_DEF(byte, unsigned char, "%c", unsigned long, strict_strtoul);
246 STANDARD_PARAM_DEF(short, short, "%hi", long, strict_strtol);
247 STANDARD_PARAM_DEF(ushort, unsigned short, "%hu", unsigned long, strict_strtoul);
248 STANDARD_PARAM_DEF(int, int, "%i", long, strict_strtol);
249 STANDARD_PARAM_DEF(uint, unsigned int, "%u", unsigned long, strict_strtoul);
250 STANDARD_PARAM_DEF(long, long, "%li", long, strict_strtol);
251 STANDARD_PARAM_DEF(ulong, unsigned long, "%lu", unsigned long, strict_strtoul);
253 int param_set_charp(const char *val, const struct kernel_param *kp)
255 if (strlen(val) > 1024) {
256 printk(KERN_ERR "%s: string parameter too long\n",
257 kp->name);
258 return -ENOSPC;
261 maybe_kfree_parameter(*(char **)kp->arg);
263 /* This is a hack. We can't kmalloc in early boot, and we
264 * don't need to; this mangled commandline is preserved. */
265 if (slab_is_available()) {
266 *(char **)kp->arg = kmalloc_parameter(strlen(val)+1);
267 if (!*(char **)kp->arg)
268 return -ENOMEM;
269 strcpy(*(char **)kp->arg, val);
270 } else
271 *(const char **)kp->arg = val;
273 return 0;
275 EXPORT_SYMBOL(param_set_charp);
277 int param_get_charp(char *buffer, const struct kernel_param *kp)
279 return sprintf(buffer, "%s", *((char **)kp->arg));
281 EXPORT_SYMBOL(param_get_charp);
283 static void param_free_charp(void *arg)
285 maybe_kfree_parameter(*((char **)arg));
288 struct kernel_param_ops param_ops_charp = {
289 .set = param_set_charp,
290 .get = param_get_charp,
291 .free = param_free_charp,
293 EXPORT_SYMBOL(param_ops_charp);
295 /* Actually could be a bool or an int, for historical reasons. */
296 int param_set_bool(const char *val, const struct kernel_param *kp)
298 bool v;
300 /* No equals means "set"... */
301 if (!val) val = "1";
303 /* One of =[yYnN01] */
304 switch (val[0]) {
305 case 'y': case 'Y': case '1':
306 v = true;
307 break;
308 case 'n': case 'N': case '0':
309 v = false;
310 break;
311 default:
312 return -EINVAL;
315 if (kp->flags & KPARAM_ISBOOL)
316 *(bool *)kp->arg = v;
317 else
318 *(int *)kp->arg = v;
319 return 0;
321 EXPORT_SYMBOL(param_set_bool);
323 int param_get_bool(char *buffer, const struct kernel_param *kp)
325 bool val;
326 if (kp->flags & KPARAM_ISBOOL)
327 val = *(bool *)kp->arg;
328 else
329 val = *(int *)kp->arg;
331 /* Y and N chosen as being relatively non-coder friendly */
332 return sprintf(buffer, "%c", val ? 'Y' : 'N');
334 EXPORT_SYMBOL(param_get_bool);
336 struct kernel_param_ops param_ops_bool = {
337 .set = param_set_bool,
338 .get = param_get_bool,
340 EXPORT_SYMBOL(param_ops_bool);
342 /* This one must be bool. */
343 int param_set_invbool(const char *val, const struct kernel_param *kp)
345 int ret;
346 bool boolval;
347 struct kernel_param dummy;
349 dummy.arg = &boolval;
350 dummy.flags = KPARAM_ISBOOL;
351 ret = param_set_bool(val, &dummy);
352 if (ret == 0)
353 *(bool *)kp->arg = !boolval;
354 return ret;
356 EXPORT_SYMBOL(param_set_invbool);
358 int param_get_invbool(char *buffer, const struct kernel_param *kp)
360 return sprintf(buffer, "%c", (*(bool *)kp->arg) ? 'N' : 'Y');
362 EXPORT_SYMBOL(param_get_invbool);
364 struct kernel_param_ops param_ops_invbool = {
365 .set = param_set_invbool,
366 .get = param_get_invbool,
368 EXPORT_SYMBOL(param_ops_invbool);
370 /* We break the rule and mangle the string. */
371 static int param_array(const char *name,
372 const char *val,
373 unsigned int min, unsigned int max,
374 void *elem, int elemsize,
375 int (*set)(const char *, const struct kernel_param *kp),
376 u16 flags,
377 unsigned int *num)
379 int ret;
380 struct kernel_param kp;
381 char save;
383 /* Get the name right for errors. */
384 kp.name = name;
385 kp.arg = elem;
386 kp.flags = flags;
388 *num = 0;
389 /* We expect a comma-separated list of values. */
390 do {
391 int len;
393 if (*num == max) {
394 printk(KERN_ERR "%s: can only take %i arguments\n",
395 name, max);
396 return -EINVAL;
398 len = strcspn(val, ",");
400 /* nul-terminate and parse */
401 save = val[len];
402 ((char *)val)[len] = '\0';
403 ret = set(val, &kp);
405 if (ret != 0)
406 return ret;
407 kp.arg += elemsize;
408 val += len+1;
409 (*num)++;
410 } while (save == ',');
412 if (*num < min) {
413 printk(KERN_ERR "%s: needs at least %i arguments\n",
414 name, min);
415 return -EINVAL;
417 return 0;
420 static int param_array_set(const char *val, const struct kernel_param *kp)
422 const struct kparam_array *arr = kp->arr;
423 unsigned int temp_num;
425 return param_array(kp->name, val, 1, arr->max, arr->elem,
426 arr->elemsize, arr->ops->set, kp->flags,
427 arr->num ?: &temp_num);
430 static int param_array_get(char *buffer, const struct kernel_param *kp)
432 int i, off, ret;
433 const struct kparam_array *arr = kp->arr;
434 struct kernel_param p;
436 p = *kp;
437 for (i = off = 0; i < (arr->num ? *arr->num : arr->max); i++) {
438 if (i)
439 buffer[off++] = ',';
440 p.arg = arr->elem + arr->elemsize * i;
441 ret = arr->ops->get(buffer + off, &p);
442 if (ret < 0)
443 return ret;
444 off += ret;
446 buffer[off] = '\0';
447 return off;
450 static void param_array_free(void *arg)
452 unsigned int i;
453 const struct kparam_array *arr = arg;
455 if (arr->ops->free)
456 for (i = 0; i < (arr->num ? *arr->num : arr->max); i++)
457 arr->ops->free(arr->elem + arr->elemsize * i);
460 struct kernel_param_ops param_array_ops = {
461 .set = param_array_set,
462 .get = param_array_get,
463 .free = param_array_free,
465 EXPORT_SYMBOL(param_array_ops);
467 int param_set_copystring(const char *val, const struct kernel_param *kp)
469 const struct kparam_string *kps = kp->str;
471 if (strlen(val)+1 > kps->maxlen) {
472 printk(KERN_ERR "%s: string doesn't fit in %u chars.\n",
473 kp->name, kps->maxlen-1);
474 return -ENOSPC;
476 strcpy(kps->string, val);
477 return 0;
479 EXPORT_SYMBOL(param_set_copystring);
481 int param_get_string(char *buffer, const struct kernel_param *kp)
483 const struct kparam_string *kps = kp->str;
484 return strlcpy(buffer, kps->string, kps->maxlen);
486 EXPORT_SYMBOL(param_get_string);
488 struct kernel_param_ops param_ops_string = {
489 .set = param_set_copystring,
490 .get = param_get_string,
492 EXPORT_SYMBOL(param_ops_string);
494 /* sysfs output in /sys/modules/XYZ/parameters/ */
495 #define to_module_attr(n) container_of(n, struct module_attribute, attr)
496 #define to_module_kobject(n) container_of(n, struct module_kobject, kobj)
498 extern struct kernel_param __start___param[], __stop___param[];
500 struct param_attribute
502 struct module_attribute mattr;
503 const struct kernel_param *param;
506 struct module_param_attrs
508 unsigned int num;
509 struct attribute_group grp;
510 struct param_attribute attrs[0];
513 #ifdef CONFIG_SYSFS
514 #define to_param_attr(n) container_of(n, struct param_attribute, mattr)
516 static ssize_t param_attr_show(struct module_attribute *mattr,
517 struct module *mod, char *buf)
519 int count;
520 struct param_attribute *attribute = to_param_attr(mattr);
522 if (!attribute->param->ops->get)
523 return -EPERM;
525 count = attribute->param->ops->get(buf, attribute->param);
526 if (count > 0) {
527 strcat(buf, "\n");
528 ++count;
530 return count;
533 /* sysfs always hands a nul-terminated string in buf. We rely on that. */
534 static ssize_t param_attr_store(struct module_attribute *mattr,
535 struct module *owner,
536 const char *buf, size_t len)
538 int err;
539 struct param_attribute *attribute = to_param_attr(mattr);
541 if (!attribute->param->ops->set)
542 return -EPERM;
544 err = attribute->param->ops->set(buf, attribute->param);
545 if (!err)
546 return len;
547 return err;
549 #endif
551 #ifdef CONFIG_MODULES
552 #define __modinit
553 #else
554 #define __modinit __init
555 #endif
557 #ifdef CONFIG_SYSFS
559 * add_sysfs_param - add a parameter to sysfs
560 * @mk: struct module_kobject
561 * @kparam: the actual parameter definition to add to sysfs
562 * @name: name of parameter
564 * Create a kobject if for a (per-module) parameter if mp NULL, and
565 * create file in sysfs. Returns an error on out of memory. Always cleans up
566 * if there's an error.
568 static __modinit int add_sysfs_param(struct module_kobject *mk,
569 const struct kernel_param *kp,
570 const char *name)
572 struct module_param_attrs *new;
573 struct attribute **attrs;
574 int err, num;
576 /* We don't bother calling this with invisible parameters. */
577 BUG_ON(!kp->perm);
579 if (!mk->mp) {
580 num = 0;
581 attrs = NULL;
582 } else {
583 num = mk->mp->num;
584 attrs = mk->mp->grp.attrs;
587 /* Enlarge. */
588 new = krealloc(mk->mp,
589 sizeof(*mk->mp) + sizeof(mk->mp->attrs[0]) * (num+1),
590 GFP_KERNEL);
591 if (!new) {
592 kfree(mk->mp);
593 err = -ENOMEM;
594 goto fail;
596 attrs = krealloc(attrs, sizeof(new->grp.attrs[0])*(num+2), GFP_KERNEL);
597 if (!attrs) {
598 err = -ENOMEM;
599 goto fail_free_new;
602 /* Sysfs wants everything zeroed. */
603 memset(new, 0, sizeof(*new));
604 memset(&new->attrs[num], 0, sizeof(new->attrs[num]));
605 memset(&attrs[num], 0, sizeof(attrs[num]));
606 new->grp.name = "parameters";
607 new->grp.attrs = attrs;
609 /* Tack new one on the end. */
610 sysfs_attr_init(&new->attrs[num].mattr.attr);
611 new->attrs[num].param = kp;
612 new->attrs[num].mattr.show = param_attr_show;
613 new->attrs[num].mattr.store = param_attr_store;
614 new->attrs[num].mattr.attr.name = (char *)name;
615 new->attrs[num].mattr.attr.mode = kp->perm;
616 new->num = num+1;
618 /* Fix up all the pointers, since krealloc can move us */
619 for (num = 0; num < new->num; num++)
620 new->grp.attrs[num] = &new->attrs[num].mattr.attr;
621 new->grp.attrs[num] = NULL;
623 mk->mp = new;
624 return 0;
626 fail_free_new:
627 kfree(new);
628 fail:
629 mk->mp = NULL;
630 return err;
633 #ifdef CONFIG_MODULES
634 static void free_module_param_attrs(struct module_kobject *mk)
636 kfree(mk->mp->grp.attrs);
637 kfree(mk->mp);
638 mk->mp = NULL;
642 * module_param_sysfs_setup - setup sysfs support for one module
643 * @mod: module
644 * @kparam: module parameters (array)
645 * @num_params: number of module parameters
647 * Adds sysfs entries for module parameters under
648 * /sys/module/[mod->name]/parameters/
650 int module_param_sysfs_setup(struct module *mod,
651 const struct kernel_param *kparam,
652 unsigned int num_params)
654 int i, err;
655 bool params = false;
657 for (i = 0; i < num_params; i++) {
658 if (kparam[i].perm == 0)
659 continue;
660 err = add_sysfs_param(&mod->mkobj, &kparam[i], kparam[i].name);
661 if (err)
662 return err;
663 params = true;
666 if (!params)
667 return 0;
669 /* Create the param group. */
670 err = sysfs_create_group(&mod->mkobj.kobj, &mod->mkobj.mp->grp);
671 if (err)
672 free_module_param_attrs(&mod->mkobj);
673 return err;
677 * module_param_sysfs_remove - remove sysfs support for one module
678 * @mod: module
680 * Remove sysfs entries for module parameters and the corresponding
681 * kobject.
683 void module_param_sysfs_remove(struct module *mod)
685 if (mod->mkobj.mp) {
686 sysfs_remove_group(&mod->mkobj.kobj, &mod->mkobj.mp->grp);
687 /* We are positive that no one is using any param
688 * attrs at this point. Deallocate immediately. */
689 free_module_param_attrs(&mod->mkobj);
692 #endif
694 void destroy_params(const struct kernel_param *params, unsigned num)
696 unsigned int i;
698 for (i = 0; i < num; i++)
699 if (params[i].ops->free)
700 params[i].ops->free(params[i].arg);
703 static void __init kernel_add_sysfs_param(const char *name,
704 struct kernel_param *kparam,
705 unsigned int name_skip)
707 struct module_kobject *mk;
708 struct kobject *kobj;
709 int err;
711 kobj = kset_find_obj(module_kset, name);
712 if (kobj) {
713 /* We already have one. Remove params so we can add more. */
714 mk = to_module_kobject(kobj);
715 /* We need to remove it before adding parameters. */
716 sysfs_remove_group(&mk->kobj, &mk->mp->grp);
717 } else {
718 mk = kzalloc(sizeof(struct module_kobject), GFP_KERNEL);
719 BUG_ON(!mk);
721 mk->mod = THIS_MODULE;
722 mk->kobj.kset = module_kset;
723 err = kobject_init_and_add(&mk->kobj, &module_ktype, NULL,
724 "%s", name);
725 if (err) {
726 kobject_put(&mk->kobj);
727 printk(KERN_ERR "Module '%s' failed add to sysfs, "
728 "error number %d\n", name, err);
729 printk(KERN_ERR "The system will be unstable now.\n");
730 return;
732 /* So that exit path is even. */
733 kobject_get(&mk->kobj);
736 /* These should not fail at boot. */
737 err = add_sysfs_param(mk, kparam, kparam->name + name_skip);
738 BUG_ON(err);
739 err = sysfs_create_group(&mk->kobj, &mk->mp->grp);
740 BUG_ON(err);
741 kobject_uevent(&mk->kobj, KOBJ_ADD);
742 kobject_put(&mk->kobj);
746 * param_sysfs_builtin - add contents in /sys/parameters for built-in modules
748 * Add module_parameters to sysfs for "modules" built into the kernel.
750 * The "module" name (KBUILD_MODNAME) is stored before a dot, the
751 * "parameter" name is stored behind a dot in kernel_param->name. So,
752 * extract the "module" name for all built-in kernel_param-eters,
753 * and for all who have the same, call kernel_add_sysfs_param.
755 static void __init param_sysfs_builtin(void)
757 struct kernel_param *kp;
758 unsigned int name_len;
759 char modname[MODULE_NAME_LEN];
761 for (kp = __start___param; kp < __stop___param; kp++) {
762 char *dot;
764 if (kp->perm == 0)
765 continue;
767 dot = strchr(kp->name, '.');
768 if (!dot) {
769 /* This happens for core_param() */
770 strcpy(modname, "kernel");
771 name_len = 0;
772 } else {
773 name_len = dot - kp->name + 1;
774 strlcpy(modname, kp->name, name_len);
776 kernel_add_sysfs_param(modname, kp, name_len);
781 /* module-related sysfs stuff */
783 static ssize_t module_attr_show(struct kobject *kobj,
784 struct attribute *attr,
785 char *buf)
787 struct module_attribute *attribute;
788 struct module_kobject *mk;
789 int ret;
791 attribute = to_module_attr(attr);
792 mk = to_module_kobject(kobj);
794 if (!attribute->show)
795 return -EIO;
797 ret = attribute->show(attribute, mk->mod, buf);
799 return ret;
802 static ssize_t module_attr_store(struct kobject *kobj,
803 struct attribute *attr,
804 const char *buf, size_t len)
806 struct module_attribute *attribute;
807 struct module_kobject *mk;
808 int ret;
810 attribute = to_module_attr(attr);
811 mk = to_module_kobject(kobj);
813 if (!attribute->store)
814 return -EIO;
816 ret = attribute->store(attribute, mk->mod, buf, len);
818 return ret;
821 static const struct sysfs_ops module_sysfs_ops = {
822 .show = module_attr_show,
823 .store = module_attr_store,
826 static int uevent_filter(struct kset *kset, struct kobject *kobj)
828 struct kobj_type *ktype = get_ktype(kobj);
830 if (ktype == &module_ktype)
831 return 1;
832 return 0;
835 static const struct kset_uevent_ops module_uevent_ops = {
836 .filter = uevent_filter,
839 struct kset *module_kset;
840 int module_sysfs_initialized;
842 struct kobj_type module_ktype = {
843 .sysfs_ops = &module_sysfs_ops,
847 * param_sysfs_init - wrapper for built-in params support
849 static int __init param_sysfs_init(void)
851 module_kset = kset_create_and_add("module", &module_uevent_ops, NULL);
852 if (!module_kset) {
853 printk(KERN_WARNING "%s (%d): error creating kset\n",
854 __FILE__, __LINE__);
855 return -ENOMEM;
857 module_sysfs_initialized = 1;
859 param_sysfs_builtin();
861 return 0;
863 subsys_initcall(param_sysfs_init);
865 #endif /* CONFIG_SYSFS */