Skip to content

Commit

Permalink
module: fix sysfs cleanup for !CONFIG_SYSFS
Browse files Browse the repository at this point in the history
Restore the stub module_remove_modinfo_attrs, remove the now-unused
!CONFIG_SYSFS module_sysfs_init.

Also, rename mod_kobject_remove() to mod_sysfs_teardown() as
it is the logical counterpart to mod_sysfs_setup now.

Reported-by: Randy Dunlap <[email protected]>
Signed-off-by: Rusty Russell <[email protected]>
  • Loading branch information
rustyrussell committed Aug 5, 2010
1 parent 8f6d037 commit 36b0360
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions kernel/module.c
Original file line number Diff line number Diff line change
Expand Up @@ -1504,11 +1504,6 @@ static void mod_sysfs_fini(struct module *mod)

#else /* !CONFIG_SYSFS */

static int mod_sysfs_init(struct module *mod)
{
return 0;
}

static int mod_sysfs_setup(struct module *mod,
const struct load_info *info,
struct kernel_param *kparam,
Expand All @@ -1521,13 +1516,17 @@ static void mod_sysfs_fini(struct module *mod)
{
}

static void module_remove_modinfo_attrs(struct module *mod)
{
}

static void del_usage_links(struct module *mod)
{
}

#endif /* CONFIG_SYSFS */

static void mod_kobject_remove(struct module *mod)
static void mod_sysfs_teardown(struct module *mod)
{
del_usage_links(mod);
module_remove_modinfo_attrs(mod);
Expand Down Expand Up @@ -1557,7 +1556,7 @@ static void free_module(struct module *mod)
mutex_lock(&module_mutex);
stop_machine(__unlink_module, mod, NULL);
mutex_unlock(&module_mutex);
mod_kobject_remove(mod);
mod_sysfs_teardown(mod);

/* Remove dynamic debug info */
ddebug_remove_module(mod->name);
Expand Down

0 comments on commit 36b0360

Please sign in to comment.