]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
modules: do not try to add sysfs attributes if !CONFIG_SYSFS
authorKay Sievers <kay.sievers@vrfy.org>
Wed, 20 Feb 2008 23:33:20 +0000 (00:33 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 21 Feb 2008 23:27:08 +0000 (15:27 -0800)
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>
kernel/module.c

index 92595bad3812c797ffd80f908b207731685df770..901cd6ac2f11d9d4b54d3bff34e10495e86f01a2 100644 (file)
@@ -987,12 +987,11 @@ static unsigned long resolve_symbol(Elf_Shdr *sechdrs,
        return ret;
 }
 
-
 /*
  * /sys/module/foo/sections stuff
  * J. Corbet <corbet@lwn.net>
  */
-#ifdef CONFIG_KALLSYMS
+#if defined(CONFIG_KALLSYMS) && defined(CONFIG_SYSFS)
 static ssize_t module_sect_show(struct module_attribute *mattr,
                                struct module *mod, char *buf)
 {
@@ -1188,7 +1187,7 @@ static inline void add_notes_attrs(struct module *mod, unsigned int nsect,
 static inline void remove_notes_attrs(struct module *mod)
 {
 }
-#endif /* CONFIG_KALLSYMS */
+#endif
 
 #ifdef CONFIG_SYSFS
 int module_add_modinfo_attrs(struct module *mod)
@@ -1231,9 +1230,7 @@ void module_remove_modinfo_attrs(struct module *mod)
        }
        kfree(mod->modinfo_attrs);
 }
-#endif
 
-#ifdef CONFIG_SYSFS
 int mod_sysfs_init(struct module *mod)
 {
        int err;