[2.6.22] powerpc: section mismatch for macmodes.c:mac_find_mode()
A vanilla 2.6.22 built for ppc32 and configured with CONFIG_FB_MACMODES=y, CONFIG_HOTPLUG=n, and CONFIG_MODULES=y, triggers the following warning from modpost:
WARNING: drivers/built-in.o(__ksymtab+0x3b0): Section mismatch: reference to .init.text:mac_find_mode (between '__ksymtab_mac_find_mode' and '__ksymtab_mac_map_monitor_sense')
There's an EXPORT_SYMBOL(mac_find_mode), but mac_find_mode() is __devinit and thus __init in this kernel.
/Mikael
PATCH 1/1 drivers/video/macmodes.c:mac_find_mode() mustn't be __devinit
Quoted 7 lines · Mikael Pettersson
A vanilla 2.6.22 built for ppc32 and configured with
CONFIG_FB_MACMODES=y,CONFIG_HOTPLUG=n, andCONFIG_MODULES=y, triggers the following warning from modpost:WARNING: drivers/built-in.o(__ksymtab+0x3b0): Section mismatch: reference to .init.text:mac_find_mode (between '
__ksymtab_mac_find_mode' and '__ksymtab_mac_map_monitor_sense')There's an
EXPORT_SYMBOL(mac_find_mode), butmac_find_mode()is__devinitand thus__initin this kernel.
So let's fix it. ;-)
Quoted 1 line
/Mikael
cu
Adrian
<-- snip -->
If it's EXPORT_SYMBOL'ed it can't be __devinit.
Reported by Mikael Pettersson.
---
@stable:
Fixes a real bug on ppc.
drivers/video/macmodes.c | 5 ++--- drivers/video/macmodes.h | 8 ++++---- 2 files changed, 6 insertions(+), 7 deletions(-)
drivers/video/macmodes.h renamed from drivers/video/macmodes.h.old +4 -4
@@ -55,10 +55,10 @@extern int mac_var_to_vmode (const struct fb_var_screeninfo *var,int *vmode,int *cmode);extern int mac_map_monitor_sense (int sense); -extern int __devinit mac_find_mode (struct fb_var_screeninfo *var, -struct fb_info *info, -const char *mode_option, -unsigned int default_bpp); +extern int mac_find_mode (struct fb_var_screeninfo *var, +struct fb_info *info, +const char *mode_option, +unsigned int default_bpp);/*
drivers/video/macmodes.c renamed from drivers/video/macmodes.c.old +2 -3
@@ -369,9 +369,8 @@* */ -int __devinit mac_find_mode (struct fb_var_screeninfo *var, -struct fb_info *info,const char *mode_option, -unsigned int default_bpp) +int mac_find_mode (struct fb_var_screeninfo *var,struct fb_info *info, +const char *mode_option,unsigned int default_bpp) {const struct fb_videomode *db =NULL ;unsigned int dbsize =0 ;