aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/params.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/params.c')
-rw-r--r--kernel/params.c28
1 files changed, 15 insertions, 13 deletions
diff --git a/kernel/params.c b/kernel/params.c
index 7d231c6c1334..7a751570b56d 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 == '-')
@@ -391,6 +389,7 @@ struct module_param_attrs
391 struct param_attribute attrs[0]; 389 struct param_attribute attrs[0];
392}; 390};
393 391
392#ifdef CONFIG_SYSFS
394#define to_param_attr(n) container_of(n, struct param_attribute, mattr); 393#define to_param_attr(n) container_of(n, struct param_attribute, mattr);
395 394
396static ssize_t param_attr_show(struct module_attribute *mattr, 395static ssize_t param_attr_show(struct module_attribute *mattr,
@@ -426,6 +425,7 @@ static ssize_t param_attr_store(struct module_attribute *mattr,
426 return len; 425 return len;
427 return err; 426 return err;
428} 427}
428#endif
429 429
430#ifdef CONFIG_MODULES 430#ifdef CONFIG_MODULES
431#define __modinit 431#define __modinit
@@ -433,6 +433,7 @@ static ssize_t param_attr_store(struct module_attribute *mattr,
433#define __modinit __init 433#define __modinit __init
434#endif 434#endif
435 435
436#ifdef CONFIG_SYSFS
436/* 437/*
437 * param_sysfs_setup - setup sysfs support for one module or KBUILD_MODNAME 438 * param_sysfs_setup - setup sysfs support for one module or KBUILD_MODNAME
438 * @mk: struct module_kobject (contains parent kobject) 439 * @mk: struct module_kobject (contains parent kobject)
@@ -500,9 +501,7 @@ param_sysfs_setup(struct module_kobject *mk,
500 return mp; 501 return mp;
501} 502}
502 503
503
504#ifdef CONFIG_MODULES 504#ifdef CONFIG_MODULES
505
506/* 505/*
507 * module_param_sysfs_setup - setup sysfs support for one module 506 * module_param_sysfs_setup - setup sysfs support for one module
508 * @mod: module 507 * @mod: module
@@ -625,7 +624,6 @@ static void __init param_sysfs_builtin(void)
625 624
626 625
627/* module-related sysfs stuff */ 626/* module-related sysfs stuff */
628#ifdef CONFIG_SYSFS
629 627
630#define to_module_attr(n) container_of(n, struct module_attribute, attr); 628#define to_module_attr(n) container_of(n, struct module_attribute, attr);
631#define to_module_kobject(n) container_of(n, struct module_kobject, kobj); 629#define to_module_kobject(n) container_of(n, struct module_kobject, kobj);
@@ -673,6 +671,8 @@ static struct sysfs_ops module_sysfs_ops = {
673 .store = module_attr_store, 671 .store = module_attr_store,
674}; 672};
675 673
674static struct kobj_type module_ktype;
675
676static int uevent_filter(struct kset *kset, struct kobject *kobj) 676static int uevent_filter(struct kset *kset, struct kobject *kobj)
677{ 677{
678 struct kobj_type *ktype = get_ktype(kobj); 678 struct kobj_type *ktype = get_ktype(kobj);
@@ -686,19 +686,12 @@ static struct kset_uevent_ops module_uevent_ops = {
686 .filter = uevent_filter, 686 .filter = uevent_filter,
687}; 687};
688 688
689#else 689decl_subsys(module, &module_ktype, &module_uevent_ops);
690static struct sysfs_ops module_sysfs_ops = {
691 .show = NULL,
692 .store = NULL,
693};
694#endif
695 690
696static struct kobj_type module_ktype = { 691static struct kobj_type module_ktype = {
697 .sysfs_ops = &module_sysfs_ops, 692 .sysfs_ops = &module_sysfs_ops,
698}; 693};
699 694
700decl_subsys(module, &module_ktype, &module_uevent_ops);
701
702/* 695/*
703 * param_sysfs_init - wrapper for built-in params support 696 * param_sysfs_init - wrapper for built-in params support
704 */ 697 */
@@ -720,6 +713,15 @@ static int __init param_sysfs_init(void)
720} 713}
721subsys_initcall(param_sysfs_init); 714subsys_initcall(param_sysfs_init);
722 715
716#else
717#if 0
718static struct sysfs_ops module_sysfs_ops = {
719 .show = NULL,
720 .store = NULL,
721};
722#endif
723#endif
724
723EXPORT_SYMBOL(param_set_byte); 725EXPORT_SYMBOL(param_set_byte);
724EXPORT_SYMBOL(param_get_byte); 726EXPORT_SYMBOL(param_get_byte);
725EXPORT_SYMBOL(param_set_short); 727EXPORT_SYMBOL(param_set_short);