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

fbdev: section cleanup in hgafb

Fix up the sections in the hgafb driver, by

* moving hga_default_var and hga_fix from .init.data to .devinit.data

* moving hga_detect() from .init.text to .devinit.text

* moving hga_fb_remove() from .text to .devexit.text

This fixes the following warnings issued by modpost:

WARNING: drivers/video/hgafb.o(.devinit.text+0x18): Section mismatch in referenc
e from the function hgafb_probe() to the function .init.text:hga_card_detect()
The function __devinit hgafb_probe() references
a function __init hga_card_detect().
If hga_card_detect is only used by hgafb_probe then
annotate hga_card_detect with a matching annotation.

WARNING: drivers/video/hgafb.o(.devinit.text+0xfe): Section mismatch in referenc
e from the function hgafb_probe() to the variable .init.data:hga_fix
The function __devinit hgafb_probe() references
a variable __initdata hga_fix.
If hga_fix is only used by hgafb_probe then
annotate hga_fix with a matching annotation.

WARNING: drivers/video/hgafb.o(.devinit.text+0x105): Section mismatch in reference from the function hgafb_probe() to the variable .init.data:hga_default_var
The function __devinit hgafb_probe() references
a variable __initdata hga_default_var.
If hga_default_var is only used by hgafb_probe then
annotate hga_default_var with a matching annotation.

Signed-off-by: Henrik Kretzschmar <henne@nachtwindheim.de>
Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: <stable@kernel.org> [if "platform-drivers: move probe to .devinit.text in drivers/video" was merged]
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Henrik Kretzschmar and committed by
Linus Torvalds
e217e6e3 bd9b5caf

+5 -5
+5 -5
drivers/video/hgafb.c
··· 106 106 107 107 /* Framebuffer driver structures */ 108 108 109 - static struct fb_var_screeninfo __initdata hga_default_var = { 109 + static struct fb_var_screeninfo hga_default_var __devinitdata = { 110 110 .xres = 720, 111 111 .yres = 348, 112 112 .xres_virtual = 720, ··· 120 120 .width = -1, 121 121 }; 122 122 123 - static struct fb_fix_screeninfo __initdata hga_fix = { 123 + static struct fb_fix_screeninfo hga_fix __devinitdata = { 124 124 .id = "HGA", 125 125 .type = FB_TYPE_PACKED_PIXELS, /* (not sure) */ 126 126 .visual = FB_VISUAL_MONO10, ··· 276 276 spin_unlock_irqrestore(&hga_reg_lock, flags); 277 277 } 278 278 279 - static int __init hga_card_detect(void) 279 + static int __devinit hga_card_detect(void) 280 280 { 281 281 int count = 0; 282 282 void __iomem *p, *q; ··· 596 596 return 0; 597 597 } 598 598 599 - static int hgafb_remove(struct platform_device *pdev) 599 + static int __devexit hgafb_remove(struct platform_device *pdev) 600 600 { 601 601 struct fb_info *info = platform_get_drvdata(pdev); 602 602 ··· 621 621 622 622 static struct platform_driver hgafb_driver = { 623 623 .probe = hgafb_probe, 624 - .remove = hgafb_remove, 624 + .remove = __devexit_p(hgafb_remove), 625 625 .driver = { 626 626 .name = "hgafb", 627 627 },