Commit 36b0360d authored by Rusty Russell's avatar Rusty Russell

module: fix sysfs cleanup for !CONFIG_SYSFS

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: default avatarRandy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
parent 8f6d0378
...@@ -1504,11 +1504,6 @@ static void mod_sysfs_fini(struct module *mod) ...@@ -1504,11 +1504,6 @@ static void mod_sysfs_fini(struct module *mod)
#else /* !CONFIG_SYSFS */ #else /* !CONFIG_SYSFS */
static int mod_sysfs_init(struct module *mod)
{
return 0;
}
static int mod_sysfs_setup(struct module *mod, static int mod_sysfs_setup(struct module *mod,
const struct load_info *info, const struct load_info *info,
struct kernel_param *kparam, struct kernel_param *kparam,
...@@ -1521,13 +1516,17 @@ static void mod_sysfs_fini(struct module *mod) ...@@ -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) static void del_usage_links(struct module *mod)
{ {
} }
#endif /* CONFIG_SYSFS */ #endif /* CONFIG_SYSFS */
static void mod_kobject_remove(struct module *mod) static void mod_sysfs_teardown(struct module *mod)
{ {
del_usage_links(mod); del_usage_links(mod);
module_remove_modinfo_attrs(mod); module_remove_modinfo_attrs(mod);
...@@ -1557,7 +1556,7 @@ static void free_module(struct module *mod) ...@@ -1557,7 +1556,7 @@ static void free_module(struct module *mod)
mutex_lock(&module_mutex); mutex_lock(&module_mutex);
stop_machine(__unlink_module, mod, NULL); stop_machine(__unlink_module, mod, NULL);
mutex_unlock(&module_mutex); mutex_unlock(&module_mutex);
mod_kobject_remove(mod); mod_sysfs_teardown(mod);
/* Remove dynamic debug info */ /* Remove dynamic debug info */
ddebug_remove_module(mod->name); ddebug_remove_module(mod->name);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment