diff options
author | Randy Dunlap <randy.dunlap@oracle.com> | 2007-02-13 18:19:06 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2007-02-16 18:19:18 -0500 |
commit | ef665c1a06be719ed9a6b0ad7967137258d9457a (patch) | |
tree | aff01a8a9ae3617fdfd1f2931aa62799f0988610 /kernel/module.c | |
parent | e4a3c3f095ecc760fc557ca87e518e2e553fab4b (diff) |
sysfs: fix build errors: uevent with CONFIG_SYSFS=n
Fix source files to build with CONFIG_SYSFS=n.
module_subsys is not available.
SYSFS=n, MODULES=y: T:y
SYSFS=n, MODULES=n: T:y
SYSFS=y, MODULES=y: T:y
SYSFS=y, MODULES=n: T:y
Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'kernel/module.c')
-rw-r--r-- | kernel/module.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/kernel/module.c b/kernel/module.c index e06b77af23fd..8c25b1a04fa6 100644 --- a/kernel/module.c +++ b/kernel/module.c | |||
@@ -1074,7 +1074,8 @@ static inline void remove_sect_attrs(struct module *mod) | |||
1074 | } | 1074 | } |
1075 | #endif /* CONFIG_KALLSYMS */ | 1075 | #endif /* CONFIG_KALLSYMS */ |
1076 | 1076 | ||
1077 | static int module_add_modinfo_attrs(struct module *mod) | 1077 | #ifdef CONFIG_SYSFS |
1078 | int module_add_modinfo_attrs(struct module *mod) | ||
1078 | { | 1079 | { |
1079 | struct module_attribute *attr; | 1080 | struct module_attribute *attr; |
1080 | struct module_attribute *temp_attr; | 1081 | struct module_attribute *temp_attr; |
@@ -1100,7 +1101,7 @@ static int module_add_modinfo_attrs(struct module *mod) | |||
1100 | return error; | 1101 | return error; |
1101 | } | 1102 | } |
1102 | 1103 | ||
1103 | static void module_remove_modinfo_attrs(struct module *mod) | 1104 | void module_remove_modinfo_attrs(struct module *mod) |
1104 | { | 1105 | { |
1105 | struct module_attribute *attr; | 1106 | struct module_attribute *attr; |
1106 | int i; | 1107 | int i; |
@@ -1115,8 +1116,10 @@ static void module_remove_modinfo_attrs(struct module *mod) | |||
1115 | } | 1116 | } |
1116 | kfree(mod->modinfo_attrs); | 1117 | kfree(mod->modinfo_attrs); |
1117 | } | 1118 | } |
1119 | #endif | ||
1118 | 1120 | ||
1119 | static int mod_sysfs_init(struct module *mod) | 1121 | #ifdef CONFIG_SYSFS |
1122 | int mod_sysfs_init(struct module *mod) | ||
1120 | { | 1123 | { |
1121 | int err; | 1124 | int err; |
1122 | 1125 | ||
@@ -1139,7 +1142,7 @@ out: | |||
1139 | return err; | 1142 | return err; |
1140 | } | 1143 | } |
1141 | 1144 | ||
1142 | static int mod_sysfs_setup(struct module *mod, | 1145 | int mod_sysfs_setup(struct module *mod, |
1143 | struct kernel_param *kparam, | 1146 | struct kernel_param *kparam, |
1144 | unsigned int num_params) | 1147 | unsigned int num_params) |
1145 | { | 1148 | { |
@@ -1175,6 +1178,7 @@ out_unreg: | |||
1175 | out: | 1178 | out: |
1176 | return err; | 1179 | return err; |
1177 | } | 1180 | } |
1181 | #endif | ||
1178 | 1182 | ||
1179 | static void mod_kobject_remove(struct module *mod) | 1183 | static void mod_kobject_remove(struct module *mod) |
1180 | { | 1184 | { |
@@ -2348,6 +2352,7 @@ void print_modules(void) | |||
2348 | printk("\n"); | 2352 | printk("\n"); |
2349 | } | 2353 | } |
2350 | 2354 | ||
2355 | #ifdef CONFIG_SYSFS | ||
2351 | static char *make_driver_name(struct device_driver *drv) | 2356 | static char *make_driver_name(struct device_driver *drv) |
2352 | { | 2357 | { |
2353 | char *driver_name; | 2358 | char *driver_name; |
@@ -2422,6 +2427,7 @@ void module_remove_driver(struct device_driver *drv) | |||
2422 | } | 2427 | } |
2423 | } | 2428 | } |
2424 | EXPORT_SYMBOL(module_remove_driver); | 2429 | EXPORT_SYMBOL(module_remove_driver); |
2430 | #endif | ||
2425 | 2431 | ||
2426 | #ifdef CONFIG_MODVERSIONS | 2432 | #ifdef CONFIG_MODVERSIONS |
2427 | /* Generate the signature for struct module here, too, for modversions. */ | 2433 | /* Generate the signature for struct module here, too, for modversions. */ |