diff options
Diffstat (limited to 'kernel/module.c')
| -rw-r--r-- | kernel/module.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/kernel/module.c b/kernel/module.c index 9da5af668a20..1eb8ca565ba0 100644 --- a/kernel/module.c +++ b/kernel/module.c | |||
| @@ -45,6 +45,8 @@ | |||
| 45 | #include <asm/cacheflush.h> | 45 | #include <asm/cacheflush.h> |
| 46 | #include <linux/license.h> | 46 | #include <linux/license.h> |
| 47 | 47 | ||
| 48 | extern int module_sysfs_initialized; | ||
| 49 | |||
| 48 | #if 0 | 50 | #if 0 |
| 49 | #define DEBUGP printk | 51 | #define DEBUGP printk |
| 50 | #else | 52 | #else |
| @@ -346,10 +348,10 @@ static void *percpu_modalloc(unsigned long size, unsigned long align, | |||
| 346 | unsigned int i; | 348 | unsigned int i; |
| 347 | void *ptr; | 349 | void *ptr; |
| 348 | 350 | ||
| 349 | if (align > SMP_CACHE_BYTES) { | 351 | if (align > PAGE_SIZE) { |
| 350 | printk(KERN_WARNING "%s: per-cpu alignment %li > %i\n", | 352 | printk(KERN_WARNING "%s: per-cpu alignment %li > %li\n", |
| 351 | name, align, SMP_CACHE_BYTES); | 353 | name, align, PAGE_SIZE); |
| 352 | align = SMP_CACHE_BYTES; | 354 | align = PAGE_SIZE; |
| 353 | } | 355 | } |
| 354 | 356 | ||
| 355 | ptr = __per_cpu_start; | 357 | ptr = __per_cpu_start; |
| @@ -430,7 +432,7 @@ static int percpu_modinit(void) | |||
| 430 | pcpu_size = kmalloc(sizeof(pcpu_size[0]) * pcpu_num_allocated, | 432 | pcpu_size = kmalloc(sizeof(pcpu_size[0]) * pcpu_num_allocated, |
| 431 | GFP_KERNEL); | 433 | GFP_KERNEL); |
| 432 | /* Static in-kernel percpu data (used). */ | 434 | /* Static in-kernel percpu data (used). */ |
| 433 | pcpu_size[0] = -ALIGN(__per_cpu_end-__per_cpu_start, SMP_CACHE_BYTES); | 435 | pcpu_size[0] = -(__per_cpu_end-__per_cpu_start); |
| 434 | /* Free room. */ | 436 | /* Free room. */ |
| 435 | pcpu_size[1] = PERCPU_ENOUGH_ROOM + pcpu_size[0]; | 437 | pcpu_size[1] = PERCPU_ENOUGH_ROOM + pcpu_size[0]; |
| 436 | if (pcpu_size[1] < 0) { | 438 | if (pcpu_size[1] < 0) { |
| @@ -1117,8 +1119,8 @@ int mod_sysfs_init(struct module *mod) | |||
| 1117 | { | 1119 | { |
| 1118 | int err; | 1120 | int err; |
| 1119 | 1121 | ||
| 1120 | if (!module_subsys.kset.subsys) { | 1122 | if (!module_sysfs_initialized) { |
| 1121 | printk(KERN_ERR "%s: module_subsys not initialized\n", | 1123 | printk(KERN_ERR "%s: module sysfs not initialized\n", |
| 1122 | mod->name); | 1124 | mod->name); |
| 1123 | err = -EINVAL; | 1125 | err = -EINVAL; |
| 1124 | goto out; | 1126 | goto out; |
| @@ -2385,7 +2387,7 @@ void module_add_driver(struct module *mod, struct device_driver *drv) | |||
| 2385 | struct kobject *mkobj; | 2387 | struct kobject *mkobj; |
| 2386 | 2388 | ||
| 2387 | /* Lookup built-in module entry in /sys/modules */ | 2389 | /* Lookup built-in module entry in /sys/modules */ |
| 2388 | mkobj = kset_find_obj(&module_subsys.kset, drv->mod_name); | 2390 | mkobj = kset_find_obj(&module_subsys, drv->mod_name); |
| 2389 | if (mkobj) { | 2391 | if (mkobj) { |
| 2390 | mk = container_of(mkobj, struct module_kobject, kobj); | 2392 | mk = container_of(mkobj, struct module_kobject, kobj); |
| 2391 | /* remember our module structure */ | 2393 | /* remember our module structure */ |
