ARM: s3c: mark s3c2440_clk_add as __init_refok
Subsystems (2)
PATCH 1/1 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.
---
I'll put this into arm-soc/fixes unless I hear objections. This replaces the earlier "clk: don't mark clkdev_add_table as init" as suggested by Russell.
arch/arm/mach-s3c24xx/clock-s3c2440.c +1 -1
@@ -163,7 +163,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;
Quoted 21 lines · Arnd Bergmann
s3c2440_clk_addis asubsys_interfacemethod and callsclkdev_add_table, which is marked as__init. The modpost script complains about this because we must not call an__initfunction from a function in the .text section, and we cannot reference an__initfunction from asubsys_interface
pointer.I have verified that the only code path into
s3c2440_clk_add()is from "int__inits3c2440_init(void)", sos3c2440_clk_addcan be marked__init_refokinstead.Without this patch, building
mini2440_defconfigresults in:WARNING:
vmlinux.o(.text+0x9848): Section mismatch in reference from the functions3c2440_clk_add()to the function .init.text:clkdev_add_table() The functions3c2440_clk_add()references
the function__initclkdev_add_table().
This is often becauses3c2440_clk_addlacks a__initannotation or the annotation ofclkdev_add_tableis wrong.
Quoted 4 lines
Signed-off-by Arnd Bergmann <[email protected]>Cc Russell King <[email protected]>Cc Mike Turquette <[email protected]>Cc Kukjin Kim <[email protected]>
Quoted 6 lines
Cc Ben Dooks <[email protected]>---
I'll put this into arm-soc/fixes unless I hear objections. This replaces the
earlier "clk: don't markclkdev_add_tableas init" as suggested by
Russell.
Quoted 1 line
Yeah, I read it just now and I agree with this patch.
Thanks for your fix.
Best regards,
Kgene.
--
Kukjin Kim <[email protected]>, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd.