From: Arnd Bergmann Date: Fri, 12 Oct 2012 11:03:28 +0000 (+0000) Subject: ARM: s3c: mark s3c2440_clk_add as __init_refok X-Git-Tag: v3.7-rc2~4^2~1^2 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=5276b6877efb8a180e254a06d7497f802f6f9755;p=linux.git ARM: s3c: mark s3c2440_clk_add as __init_refok s3c2440_clk_add is a subsys_interface method and calls clkdev_add_table, which is marked as __init. The modpost script complains about this because we must not call an __init function from a function in the .text section, and we cannot reference an __init function from a subsys_interface pointer. I have verified that the only code path into s3c2440_clk_add() is from "int __init s3c2440_init(void)", so s3c2440_clk_add can be marked __init_refok instead. Without this patch, building mini2440_defconfig results in: WARNING: vmlinux.o(.text+0x9848): Section mismatch in reference from the function s3c2440_clk_add() to the function .init.text:clkdev_add_table() The function s3c2440_clk_add() references the function __init clkdev_add_table(). This is often because s3c2440_clk_add lacks a __init annotation or the annotation of clkdev_add_table is wrong. Signed-off-by: Arnd Bergmann Acked-by: Kukjin Kim Cc: Russell King Cc: Mike Turquette Cc: Ben Dooks --- diff --git a/arch/arm/mach-s3c24xx/clock-s3c2440.c b/arch/arm/mach-s3c24xx/clock-s3c2440.c index cb2883d553b5..937a571d1b32 100644 --- a/arch/arm/mach-s3c24xx/clock-s3c2440.c +++ b/arch/arm/mach-s3c24xx/clock-s3c2440.c @@ -149,7 +149,7 @@ static struct clk_lookup s3c2440_clk_lookup[] = { CLKDEV_INIT(NULL, "clk_uart_baud3", &s3c2440_clk_fclk_n), }; -static int s3c2440_clk_add(struct device *dev, struct subsys_interface *sif) +static int __init_refok s3c2440_clk_add(struct device *dev, struct subsys_interface *sif) { struct clk *clock_upll; struct clk *clock_h;