diff options
author | Kay Sievers <kay.sievers@vrfy.org> | 2008-02-20 18:33:20 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2008-02-21 18:27:08 -0500 |
commit | 120fc3d77acfd91f3521737a440d42839c475982 (patch) | |
tree | 8f13e2fbad7f5aeafcf0a2bf6a235bddcbede6a3 | |
parent | 58dc3232ff77158460f79e3c1932b81e8a2a0194 (diff) |
modules: do not try to add sysfs attributes if !CONFIG_SYSFS
Thanks to Alexey for the testing and the fix of the fix.
Cc: Alexey Dobriyan <adobriyan@sw.ru>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r-- | kernel/module.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/kernel/module.c b/kernel/module.c index 92595bad3812..901cd6ac2f11 100644 --- a/kernel/module.c +++ b/kernel/module.c | |||
@@ -987,12 +987,11 @@ static unsigned long resolve_symbol(Elf_Shdr *sechdrs, | |||
987 | return ret; | 987 | return ret; |
988 | } | 988 | } |
989 | 989 | ||
990 | |||
991 | /* | 990 | /* |
992 | * /sys/module/foo/sections stuff | 991 | * /sys/module/foo/sections stuff |
993 | * J. Corbet <corbet@lwn.net> | 992 | * J. Corbet <corbet@lwn.net> |
994 | */ | 993 | */ |
995 | #ifdef CONFIG_KALLSYMS | 994 | #if defined(CONFIG_KALLSYMS) && defined(CONFIG_SYSFS) |
996 | static ssize_t module_sect_show(struct module_attribute *mattr, | 995 | static ssize_t module_sect_show(struct module_attribute *mattr, |
997 | struct module *mod, char *buf) | 996 | struct module *mod, char *buf) |
998 | { | 997 | { |
@@ -1188,7 +1187,7 @@ static inline void add_notes_attrs(struct module *mod, unsigned int nsect, | |||
1188 | static inline void remove_notes_attrs(struct module *mod) | 1187 | static inline void remove_notes_attrs(struct module *mod) |
1189 | { | 1188 | { |
1190 | } | 1189 | } |
1191 | #endif /* CONFIG_KALLSYMS */ | 1190 | #endif |
1192 | 1191 | ||
1193 | #ifdef CONFIG_SYSFS | 1192 | #ifdef CONFIG_SYSFS |
1194 | int module_add_modinfo_attrs(struct module *mod) | 1193 | int module_add_modinfo_attrs(struct module *mod) |
@@ -1231,9 +1230,7 @@ void module_remove_modinfo_attrs(struct module *mod) | |||
1231 | } | 1230 | } |
1232 | kfree(mod->modinfo_attrs); | 1231 | kfree(mod->modinfo_attrs); |
1233 | } | 1232 | } |
1234 | #endif | ||
1235 | 1233 | ||
1236 | #ifdef CONFIG_SYSFS | ||
1237 | int mod_sysfs_init(struct module *mod) | 1234 | int mod_sysfs_init(struct module *mod) |
1238 | { | 1235 | { |
1239 | int err; | 1236 | int err; |