Skip to contentSkip to conversation

nvram driver not possible as a module

PATCH New Joerg Dorchain 2 participants 4 messages Jan 19, 2005 – Jan 22, 2005 PowerPC

lore
Share & tools
lore
#0 lore raw

Hi,

KConfig says CONFIG_NVRAM is possible as a module. Loading the module fails because of an unknown symbol __alloc_bootmem. __alloc_bootmem is marked __init. The obvious workaround is to compile the driver not as a module, but how can this get really fixed?

Bye,

Joerg

#1 lore raw

Hi Joerg,

Quoted 4 lines · Joerg Dorchain

KConfig says CONFIG_NVRAM is possible as a module. Loading the module fails because of an unknown symbol __alloc_bootmem. __alloc_bootmem is marked __init. The obvious workaround is to compile the driver not as a module, but how can this get really fixed?

Does this help:

arch/ppc/platforms/pmac_nvram.c +1 -1
@@ -488,7 +488,7 @@
 			printk(KERN_ERR "nvram: no address\n");
 			return;
 		}
-		nvram_image = alloc_bootmem(NVRAM_SIZE);
+		nvram_image = kmalloc(NVRAM_SIZE, GFP_KERNEL);
 		if (nvram_image == NULL) {
 			printk(KERN_ERR "nvram: can't allocate ram image\n");
 			return;

Cheers,
-- Guido

#2 lore raw
Quoted 7 lines · Guido Guenther

Hi Joerg,

Quoted 4 lines · Joerg Dorchain

KConfig says CONFIG_NVRAM is possible as a module. Loading the module fails because of an unknown symbol __alloc_bootmem. __alloc_bootmem is marked __init. The obvious workaround is to compile the driver not as a module, but how can this get really fixed?

Does this help:

[...]

Most likely, if there wasn't a specific reason to use bootmem.

I'll try tonight.

Thanks,

Joerg

#3 lore raw

PATCH 1/1 nvram driver as module (was Re: nvram driver not possible as a module)

Quoted 6 lines · Joerg Dorchain
Quoted 1 line

Does this help:

[...]

Most likely, if there wasn't a specific reason to use bootmem.

I'll try tonight.

Well, it did not crash. The following does even work ;-)

include/asm-ppc/system.h renamed from include/asm-ppc/system.h.orig +1 -1
@@ -69,7 +69,7 @@
 #define _set_L3CR(val)	do { } while(0)
 #endif
 extern void via_cuda_init(void);
-extern void pmac_nvram_init(void);
+extern int pmac_nvram_init(void);
 extern void read_rtc_time(void);
 extern void pmac_find_display(void);
 extern void giveup_fpu(struct task_struct *);
ppc/platforms/pmac_nvram.c renamed from ppc/platforms/pmac_nvram.c.orig +36 -7

91 lines not on this page · raw message