Skip to content

Commit 21e38df

Browse files
tbreedspaulusmack
authored andcommitted
[POWERPC] Fix building of pmac32 when CONFIG_NVRAM=m
Kamalesh Babulal (kamalesh@linux.vnet.ibm.com) reports that CONFIG_NVRAM=m is valid in terms of Kconfig but fails to build with: Building modules, stage 2. MODPOST 1401 modules ERROR: "pmac_newworld" [arch/powerpc/platforms/powermac/nvram.ko] undefined! ERROR: "__alloc_bootmem" [arch/powerpc/platforms/powermac/nvram.ko] undefined! make[1]: *** [__modpost] Error The arch/powerpc/platforms/powermac/nvram.c code really needs to be builtin, but as its compilation is dependent on a generic Kconfig symbol we force nvram.c to be builtin if CONFIG_NVRAM is 'y' or 'm'. Signed-off-by: Tony Breeds <tony@bakeyournoodle.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
1 parent 8521882 commit 21e38df

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

‎arch/powerpc/platforms/powermac/Makefile‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@ obj-y += pic.o setup.o time.o feature.o pci.o \
66
obj-$(CONFIG_PMAC_BACKLIGHT) += backlight.o
77
obj-$(CONFIG_CPU_FREQ_PMAC) += cpufreq_32.o
88
obj-$(CONFIG_CPU_FREQ_PMAC64) += cpufreq_64.o
9-
obj-$(CONFIG_NVRAM) += nvram.o
9+
# CONFIG_NVRAM is an arch. independant tristate symbol, for pmac32 we really
10+
# need this to be a bool. Cheat here and pretend CONFIG_NVRAM=m is really
11+
# CONFIG_NVRAM=y
12+
obj-$(CONFIG_NVRAM:m=y) += nvram.o
1013
# ppc64 pmac doesn't define CONFIG_NVRAM but needs nvram stuff
1114
obj-$(CONFIG_PPC64) += nvram.o
1215
obj-$(CONFIG_PPC32) += bootx_init.o

‎arch/powerpc/platforms/powermac/setup.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,8 @@ static void __init pmac_setup_arch(void)
337337
find_via_pmu();
338338
smu_init();
339339

340-
#if defined(CONFIG_NVRAM) || defined(CONFIG_PPC64)
340+
#if defined(CONFIG_NVRAM) || defined(CONFIG_NVRAM_MODULE) || \
341+
defined(CONFIG_PPC64)
341342
pmac_nvram_init();
342343
#endif
343344

0 commit comments

Comments
 (0)