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

ARM: mxs: remove custom .init_time hook

This patch converts clk-imx2[38] clocksource_of_init compatible init
associated with fsl,imx2[38]-clkctrl. With arch/arm calling
of_clk_init(NULL) from time_init(), we can now also remove custom
.init_time hooks.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Acked-by: Mike Turquette <mturquette@linaro.org>
Acked-by: Shawn Guo <shawn.guo@linaro.org>

+16 -30
-13
arch/arm/mach-mxs/mach-mxs.c
··· 13 13 #include <linux/clk.h> 14 14 #include <linux/clk/mxs.h> 15 15 #include <linux/clkdev.h> 16 - #include <linux/clocksource.h> 17 - #include <linux/clk-provider.h> 18 16 #include <linux/delay.h> 19 17 #include <linux/err.h> 20 18 #include <linux/gpio.h> ··· 488 490 soft_restart(0); 489 491 } 490 492 491 - static void __init mxs_timer_init(void) 492 - { 493 - if (of_machine_is_compatible("fsl,imx23")) 494 - mx23_clocks_init(); 495 - else 496 - mx28_clocks_init(); 497 - of_clk_init(NULL); 498 - clocksource_of_init(); 499 - } 500 - 501 493 static const char *mxs_dt_compat[] __initdata = { 502 494 "fsl,imx28", 503 495 "fsl,imx23", ··· 496 508 497 509 DT_MACHINE_START(MXS, "Freescale MXS (Device Tree)") 498 510 .handle_irq = icoll_handle_irq, 499 - .init_time = mxs_timer_init, 500 511 .init_machine = mxs_machine_init, 501 512 .init_late = mxs_pm_init, 502 513 .dt_compat = mxs_dt_compat,
+8 -7
drivers/clk/mxs/clk-imx23.c
··· 12 12 #include <linux/clk.h> 13 13 #include <linux/clk/mxs.h> 14 14 #include <linux/clkdev.h> 15 + #include <linux/clk-provider.h> 15 16 #include <linux/err.h> 16 17 #include <linux/init.h> 17 18 #include <linux/io.h> ··· 101 100 cpu, hbus, xbus, emi, uart, 102 101 }; 103 102 104 - int __init mx23_clocks_init(void) 103 + static void __init mx23_clocks_init(struct device_node *np) 105 104 { 106 - struct device_node *np; 105 + struct device_node *dcnp; 107 106 u32 i; 108 107 109 - np = of_find_compatible_node(NULL, NULL, "fsl,imx23-digctl"); 110 - digctrl = of_iomap(np, 0); 108 + dcnp = of_find_compatible_node(NULL, NULL, "fsl,imx23-digctl"); 109 + digctrl = of_iomap(dcnp, 0); 111 110 WARN_ON(!digctrl); 111 + of_node_put(dcnp); 112 112 113 - np = of_find_compatible_node(NULL, NULL, "fsl,imx23-clkctrl"); 114 113 clkctrl = of_iomap(np, 0); 115 114 WARN_ON(!clkctrl); 116 115 ··· 163 162 if (IS_ERR(clks[i])) { 164 163 pr_err("i.MX23 clk %d: register failed with %ld\n", 165 164 i, PTR_ERR(clks[i])); 166 - return PTR_ERR(clks[i]); 165 + return; 167 166 } 168 167 169 168 clk_data.clks = clks; ··· 173 172 for (i = 0; i < ARRAY_SIZE(clks_init_on); i++) 174 173 clk_prepare_enable(clks[clks_init_on[i]]); 175 174 176 - return 0; 177 175 } 176 + CLK_OF_DECLARE(imx23_clkctrl, "fsl,imx23-clkctrl", mx23_clocks_init);
+8 -8
drivers/clk/mxs/clk-imx28.c
··· 12 12 #include <linux/clk.h> 13 13 #include <linux/clk/mxs.h> 14 14 #include <linux/clkdev.h> 15 + #include <linux/clk-provider.h> 15 16 #include <linux/err.h> 16 17 #include <linux/init.h> 17 18 #include <linux/io.h> ··· 155 154 cpu, hbus, xbus, emi, uart, 156 155 }; 157 156 158 - int __init mx28_clocks_init(void) 157 + static void __init mx28_clocks_init(struct device_node *np) 159 158 { 160 - struct device_node *np; 159 + struct device_node *dcnp; 161 160 u32 i; 162 161 163 - np = of_find_compatible_node(NULL, NULL, "fsl,imx28-digctl"); 164 - digctrl = of_iomap(np, 0); 162 + dcnp = of_find_compatible_node(NULL, NULL, "fsl,imx28-digctl"); 163 + digctrl = of_iomap(dcnp, 0); 165 164 WARN_ON(!digctrl); 165 + of_node_put(dcnp); 166 166 167 - np = of_find_compatible_node(NULL, NULL, "fsl,imx28-clkctrl"); 168 167 clkctrl = of_iomap(np, 0); 169 168 WARN_ON(!clkctrl); 170 169 ··· 240 239 if (IS_ERR(clks[i])) { 241 240 pr_err("i.MX28 clk %d: register failed with %ld\n", 242 241 i, PTR_ERR(clks[i])); 243 - return PTR_ERR(clks[i]); 242 + return; 244 243 } 245 244 246 245 clk_data.clks = clks; ··· 251 250 252 251 for (i = 0; i < ARRAY_SIZE(clks_init_on); i++) 253 252 clk_prepare_enable(clks[clks_init_on[i]]); 254 - 255 - return 0; 256 253 } 254 + CLK_OF_DECLARE(imx28_clkctrl, "fsl,imx28-clkctrl", mx28_clocks_init);
-2
include/linux/clk/mxs.h
··· 9 9 #ifndef __LINUX_CLK_MXS_H 10 10 #define __LINUX_CLK_MXS_H 11 11 12 - int mx23_clocks_init(void); 13 - int mx28_clocks_init(void); 14 12 int mxs_saif_clkmux_select(unsigned int clkmux); 15 13 16 14 #endif