Skip to content

Commit

Permalink
modules: do not try to add sysfs attributes if !CONFIG_SYSFS
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Kay Sievers authored and Greg Kroah-Hartman committed Feb 21, 2008
1 parent 58dc323 commit 120fc3d
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions kernel/module.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 120fc3d

Please sign in to comment.