diff options
author | Kevin Hao <haokexin@gmail.com> | 2014-12-03 03:53:53 -0500 |
---|---|---|
committer | Michael Turquette <mturquette@linaro.org> | 2015-01-20 13:09:03 -0500 |
commit | 66619ac512577572ab464fce9021baa846aa16d7 (patch) | |
tree | 33125dfaaee69cd482767791f90a5e40959b7ddd | |
parent | f0d373009205b53c7e14b6ac6d939ac5dcce60ca (diff) |
clk: ppc-corenet: fix section mismatch warning
In order to fix the following section mismatch warning:
WARNING: drivers/clk/built-in.o(.data+0xe4): Section mismatch in reference from the variable ppc_corenet_clk_driver to the function .init.text:ppc_corenet_clk_probe()
The variable ppc_corenet_clk_driver references
the function __init ppc_corenet_clk_probe()
If the reference is valid then annotate the
variable with __init* or __refdata (see linux/init.h) or name the variable:
*_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console
WARNING: drivers/clk/built-in.o(.data+0x10c): Section mismatch in reference from the variable ppc_corenet_clk_driver to the variable .init.rodata:ppc_clk_ids
The variable ppc_corenet_clk_driver references
the variable __initconst ppc_clk_ids
If the reference is valid then annotate the
variable with __init* or __refdata (see linux/init.h) or name the variable:
*_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console
We can't just add the __init annotation to ppc_corenet_clk_driver or
remove the __init from ppc_corenet_clk_probe() and ppc_clk_ids.
So choose to use CLK_OF_DECLARE to scan and init the clock devices.
Signed-off-by: Kevin Hao <haokexin@gmail.com>
Acked-by: Scott Wood <scottwood@freescale.com>
Acked-by: Michael Turquette <mturquette@linaro.org>
Signed-off-by: Michael Turquette <mturquette@linaro.org>
-rw-r--r-- | drivers/clk/clk-ppc-corenet.c | 43 |
1 files changed, 6 insertions, 37 deletions
diff --git a/drivers/clk/clk-ppc-corenet.c b/drivers/clk/clk-ppc-corenet.c index 0a47d6f49cd6..57a2de47d2cb 100644 --- a/drivers/clk/clk-ppc-corenet.c +++ b/drivers/clk/clk-ppc-corenet.c | |||
@@ -267,40 +267,9 @@ static void __init sysclk_init(struct device_node *node) | |||
267 | if (!IS_ERR(clk)) | 267 | if (!IS_ERR(clk)) |
268 | of_clk_add_provider(np, of_clk_src_simple_get, clk); | 268 | of_clk_add_provider(np, of_clk_src_simple_get, clk); |
269 | } | 269 | } |
270 | 270 | CLK_OF_DECLARE(qoriq_sysclk_1, "fsl,qoriq-sysclk-1.0", sysclk_init); | |
271 | static const struct of_device_id clk_match[] __initconst = { | 271 | CLK_OF_DECLARE(qoriq_sysclk_2, "fsl,qoriq-sysclk-2.0", sysclk_init); |
272 | { .compatible = "fsl,qoriq-sysclk-1.0", .data = sysclk_init, }, | 272 | CLK_OF_DECLARE(qoriq_core_pll_1, "fsl,qoriq-core-pll-1.0", core_pll_init); |
273 | { .compatible = "fsl,qoriq-sysclk-2.0", .data = sysclk_init, }, | 273 | CLK_OF_DECLARE(qoriq_core_pll_2, "fsl,qoriq-core-pll-2.0", core_pll_init); |
274 | { .compatible = "fsl,qoriq-core-pll-1.0", .data = core_pll_init, }, | 274 | CLK_OF_DECLARE(qoriq_core_mux_1, "fsl,qoriq-core-mux-1.0", core_mux_init); |
275 | { .compatible = "fsl,qoriq-core-pll-2.0", .data = core_pll_init, }, | 275 | CLK_OF_DECLARE(qoriq_core_mux_2, "fsl,qoriq-core-mux-2.0", core_mux_init); |
276 | { .compatible = "fsl,qoriq-core-mux-1.0", .data = core_mux_init, }, | ||
277 | { .compatible = "fsl,qoriq-core-mux-2.0", .data = core_mux_init, }, | ||
278 | {} | ||
279 | }; | ||
280 | |||
281 | static int __init ppc_corenet_clk_probe(struct platform_device *pdev) | ||
282 | { | ||
283 | of_clk_init(clk_match); | ||
284 | |||
285 | return 0; | ||
286 | } | ||
287 | |||
288 | static const struct of_device_id ppc_clk_ids[] __initconst = { | ||
289 | { .compatible = "fsl,qoriq-clockgen-1.0", }, | ||
290 | { .compatible = "fsl,qoriq-clockgen-2.0", }, | ||
291 | {} | ||
292 | }; | ||
293 | |||
294 | static struct platform_driver ppc_corenet_clk_driver = { | ||
295 | .driver = { | ||
296 | .name = "ppc_corenet_clock", | ||
297 | .of_match_table = ppc_clk_ids, | ||
298 | }, | ||
299 | .probe = ppc_corenet_clk_probe, | ||
300 | }; | ||
301 | |||
302 | static int __init ppc_corenet_clk_init(void) | ||
303 | { | ||
304 | return platform_driver_register(&ppc_corenet_clk_driver); | ||
305 | } | ||
306 | subsys_initcall(ppc_corenet_clk_init); | ||