aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <greg@kroah.com>2004-05-10 23:32:24 -0700
committerGreg Kroah-Hartman <greg@kroah.com>2004-05-10 23:32:24 -0700
commit31c4141f53d272c501d5a71bf34a52301d60ab29 (patch)
treec091b98042f1af03d3caef13f25dc2d3751dbe4f /kernel
parentb863a25d3dca56d4c84c3cdcca089a42f1c088be (diff)
downloadhistory-31c4141f53d272c501d5a71bf34a52301d60ab29.tar.gz
Module attributes: fix build error if CONFIG_MODULE_UNLOAD=n
Thanks to Andrew Morton for pointing this out to me.
Diffstat (limited to 'kernel')
-rw-r--r--kernel/module.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/kernel/module.c b/kernel/module.c
index 4c2af4d67df244..bbea6f7d710c53 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -379,6 +379,22 @@ static inline void percpu_modcopy(void *pcpudst, const void *src,
}
#endif /* CONFIG_SMP */
+static int add_attribute(struct module *mod, struct kernel_param *kp)
+{
+ struct module_attribute *a;
+ int retval;
+
+ a = &mod->mkobj->attr[mod->mkobj->num_attributes];
+ a->attr.name = (char *)kp->name;
+ a->attr.owner = mod;
+ a->attr.mode = kp->perm;
+ a->param = kp;
+ retval = sysfs_create_file(&mod->mkobj->kobj, &a->attr);
+ if (!retval)
+ mod->mkobj->num_attributes++;
+ return retval;
+}
+
#ifdef CONFIG_MODULE_UNLOAD
/* Init the unload section of the module. */
static void module_unload_init(struct module *mod)
@@ -504,22 +520,6 @@ static int try_stop_module(struct module *mod, int flags, int *forced)
return stop_machine_run(__try_stop_module, &sref, NR_CPUS);
}
-static int add_attribute(struct module *mod, struct kernel_param *kp)
-{
- struct module_attribute *a;
- int retval;
-
- a = &mod->mkobj->attr[mod->mkobj->num_attributes];
- a->attr.name = (char *)kp->name;
- a->attr.owner = mod;
- a->attr.mode = kp->perm;
- a->param = kp;
- retval = sysfs_create_file(&mod->mkobj->kobj, &a->attr);
- if (!retval)
- mod->mkobj->num_attributes++;
- return retval;
-}
-
unsigned int module_refcount(struct module *mod)
{
unsigned int i, total = 0;