diff options
author | Randy Dunlap <randy.dunlap@oracle.com> | 2007-02-13 18:19:06 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2007-02-16 18:19:18 -0500 |
commit | ef665c1a06be719ed9a6b0ad7967137258d9457a (patch) | |
tree | aff01a8a9ae3617fdfd1f2931aa62799f0988610 /include | |
parent | e4a3c3f095ecc760fc557ca87e518e2e553fab4b (diff) |
sysfs: fix build errors: uevent with CONFIG_SYSFS=n
Fix source files to build with CONFIG_SYSFS=n.
module_subsys is not available.
SYSFS=n, MODULES=y: T:y
SYSFS=n, MODULES=n: T:y
SYSFS=y, MODULES=y: T:y
SYSFS=y, MODULES=n: T:y
Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/module.h | 53 | ||||
-rw-r--r-- | include/linux/moduleparam.h | 12 |
2 files changed, 56 insertions, 9 deletions
diff --git a/include/linux/module.h b/include/linux/module.h index 419d3ef293dd..95679eb8571e 100644 --- a/include/linux/module.h +++ b/include/linux/module.h | |||
@@ -76,8 +76,6 @@ void sort_extable(struct exception_table_entry *start, | |||
76 | struct exception_table_entry *finish); | 76 | struct exception_table_entry *finish); |
77 | void sort_main_extable(void); | 77 | void sort_main_extable(void); |
78 | 78 | ||
79 | extern struct subsystem module_subsys; | ||
80 | |||
81 | #ifdef MODULE | 79 | #ifdef MODULE |
82 | #define MODULE_GENERIC_TABLE(gtype,name) \ | 80 | #define MODULE_GENERIC_TABLE(gtype,name) \ |
83 | extern const struct gtype##_id __mod_##gtype##_table \ | 81 | extern const struct gtype##_id __mod_##gtype##_table \ |
@@ -467,10 +465,6 @@ int unregister_module_notifier(struct notifier_block * nb); | |||
467 | 465 | ||
468 | extern void print_modules(void); | 466 | extern void print_modules(void); |
469 | 467 | ||
470 | struct device_driver; | ||
471 | void module_add_driver(struct module *, struct device_driver *); | ||
472 | void module_remove_driver(struct device_driver *); | ||
473 | |||
474 | #else /* !CONFIG_MODULES... */ | 468 | #else /* !CONFIG_MODULES... */ |
475 | #define EXPORT_SYMBOL(sym) | 469 | #define EXPORT_SYMBOL(sym) |
476 | #define EXPORT_SYMBOL_GPL(sym) | 470 | #define EXPORT_SYMBOL_GPL(sym) |
@@ -568,18 +562,59 @@ static inline void print_modules(void) | |||
568 | { | 562 | { |
569 | } | 563 | } |
570 | 564 | ||
565 | #endif /* CONFIG_MODULES */ | ||
566 | |||
571 | struct device_driver; | 567 | struct device_driver; |
568 | #ifdef CONFIG_SYSFS | ||
572 | struct module; | 569 | struct module; |
573 | 570 | ||
574 | static inline void module_add_driver(struct module *module, struct device_driver *driver) | 571 | extern struct subsystem module_subsys; |
572 | |||
573 | int mod_sysfs_init(struct module *mod); | ||
574 | int mod_sysfs_setup(struct module *mod, | ||
575 | struct kernel_param *kparam, | ||
576 | unsigned int num_params); | ||
577 | int module_add_modinfo_attrs(struct module *mod); | ||
578 | void module_remove_modinfo_attrs(struct module *mod); | ||
579 | |||
580 | #else /* !CONFIG_SYSFS */ | ||
581 | |||
582 | static inline int mod_sysfs_init(struct module *mod) | ||
575 | { | 583 | { |
584 | return 0; | ||
576 | } | 585 | } |
577 | 586 | ||
578 | static inline void module_remove_driver(struct device_driver *driver) | 587 | static inline int mod_sysfs_setup(struct module *mod, |
588 | struct kernel_param *kparam, | ||
589 | unsigned int num_params) | ||
579 | { | 590 | { |
591 | return 0; | ||
580 | } | 592 | } |
581 | 593 | ||
582 | #endif /* CONFIG_MODULES */ | 594 | static inline int module_add_modinfo_attrs(struct module *mod) |
595 | { | ||
596 | return 0; | ||
597 | } | ||
598 | |||
599 | static inline void module_remove_modinfo_attrs(struct module *mod) | ||
600 | { } | ||
601 | |||
602 | #endif /* CONFIG_SYSFS */ | ||
603 | |||
604 | #if defined(CONFIG_SYSFS) && defined(CONFIG_MODULES) | ||
605 | |||
606 | void module_add_driver(struct module *mod, struct device_driver *drv); | ||
607 | void module_remove_driver(struct device_driver *drv); | ||
608 | |||
609 | #else /* not both CONFIG_SYSFS && CONFIG_MODULES */ | ||
610 | |||
611 | static inline void module_add_driver(struct module *mod, struct device_driver *drv) | ||
612 | { } | ||
613 | |||
614 | static inline void module_remove_driver(struct device_driver *drv) | ||
615 | { } | ||
616 | |||
617 | #endif | ||
583 | 618 | ||
584 | #define symbol_request(x) try_then_request_module(symbol_get(x), "symbol:" #x) | 619 | #define symbol_request(x) try_then_request_module(symbol_get(x), "symbol:" #x) |
585 | 620 | ||
diff --git a/include/linux/moduleparam.h b/include/linux/moduleparam.h index 4a189dadb160..b26b2e5fedc7 100644 --- a/include/linux/moduleparam.h +++ b/include/linux/moduleparam.h | |||
@@ -169,10 +169,22 @@ extern int param_get_string(char *buffer, struct kernel_param *kp); | |||
169 | 169 | ||
170 | struct module; | 170 | struct module; |
171 | 171 | ||
172 | #if defined(CONFIG_SYSFS) && defined(CONFIG_MODULES) | ||
172 | extern int module_param_sysfs_setup(struct module *mod, | 173 | extern int module_param_sysfs_setup(struct module *mod, |
173 | struct kernel_param *kparam, | 174 | struct kernel_param *kparam, |
174 | unsigned int num_params); | 175 | unsigned int num_params); |
175 | 176 | ||
176 | extern void module_param_sysfs_remove(struct module *mod); | 177 | extern void module_param_sysfs_remove(struct module *mod); |
178 | #else | ||
179 | static inline int module_param_sysfs_setup(struct module *mod, | ||
180 | struct kernel_param *kparam, | ||
181 | unsigned int num_params) | ||
182 | { | ||
183 | return 0; | ||
184 | } | ||
185 | |||
186 | static inline void module_param_sysfs_remove(struct module *mod) | ||
187 | { } | ||
188 | #endif | ||
177 | 189 | ||
178 | #endif /* _LINUX_MODULE_PARAMS_H */ | 190 | #endif /* _LINUX_MODULE_PARAMS_H */ |