Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[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>

authored by

Tony Breeds and committed by
Paul Mackerras
21e38dfe 85218827

+6 -2
+4 -1
arch/powerpc/platforms/powermac/Makefile
··· 6 6 obj-$(CONFIG_PMAC_BACKLIGHT) += backlight.o 7 7 obj-$(CONFIG_CPU_FREQ_PMAC) += cpufreq_32.o 8 8 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 10 13 # ppc64 pmac doesn't define CONFIG_NVRAM but needs nvram stuff 11 14 obj-$(CONFIG_PPC64) += nvram.o 12 15 obj-$(CONFIG_PPC32) += bootx_init.o
+2 -1
arch/powerpc/platforms/powermac/setup.c
··· 337 337 find_via_pmu(); 338 338 smu_init(); 339 339 340 - #if defined(CONFIG_NVRAM) || defined(CONFIG_PPC64) 340 + #if defined(CONFIG_NVRAM) || defined(CONFIG_NVRAM_MODULE) || \ 341 + defined(CONFIG_PPC64) 341 342 pmac_nvram_init(); 342 343 #endif 343 344