diff options
author | Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> | 2013-09-04 07:16:01 -0400 |
---|---|---|
committer | Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> | 2013-09-29 15:09:34 -0400 |
commit | dd03ee9ae5bc080297175c921b1a693d0de1e8b0 (patch) | |
tree | 58692928c92834a86bc51ea1a60f0ae94529eaf0 | |
parent | a169e3aa37f33ca88131168e46bf23a317de6ace (diff) |
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>
-rw-r--r-- | arch/arm/mach-mxs/mach-mxs.c | 13 | ||||
-rw-r--r-- | drivers/clk/mxs/clk-imx23.c | 15 | ||||
-rw-r--r-- | drivers/clk/mxs/clk-imx28.c | 16 | ||||
-rw-r--r-- | include/linux/clk/mxs.h | 2 |
4 files changed, 16 insertions, 30 deletions
diff --git a/arch/arm/mach-mxs/mach-mxs.c b/arch/arm/mach-mxs/mach-mxs.c index 98f6e2adb53e..cc511a4890a3 100644 --- a/arch/arm/mach-mxs/mach-mxs.c +++ b/arch/arm/mach-mxs/mach-mxs.c | |||
@@ -13,8 +13,6 @@ | |||
13 | #include <linux/clk.h> | 13 | #include <linux/clk.h> |
14 | #include <linux/clk/mxs.h> | 14 | #include <linux/clk/mxs.h> |
15 | #include <linux/clkdev.h> | 15 | #include <linux/clkdev.h> |
16 | #include <linux/clocksource.h> | ||
17 | #include <linux/clk-provider.h> | ||
18 | #include <linux/delay.h> | 16 | #include <linux/delay.h> |
19 | #include <linux/err.h> | 17 | #include <linux/err.h> |
20 | #include <linux/gpio.h> | 18 | #include <linux/gpio.h> |
@@ -490,16 +488,6 @@ static void mxs_restart(enum reboot_mode mode, const char *cmd) | |||
490 | soft_restart(0); | 488 | soft_restart(0); |
491 | } | 489 | } |
492 | 490 | ||
493 | static void __init mxs_timer_init(void) | ||
494 | { | ||
495 | if (of_machine_is_compatible("fsl,imx23")) | ||
496 | mx23_clocks_init(); | ||
497 | else | ||
498 | mx28_clocks_init(); | ||
499 | of_clk_init(NULL); | ||
500 | clocksource_of_init(); | ||
501 | } | ||
502 | |||
503 | static const char *mxs_dt_compat[] __initdata = { | 491 | static const char *mxs_dt_compat[] __initdata = { |
504 | "fsl,imx28", | 492 | "fsl,imx28", |
505 | "fsl,imx23", | 493 | "fsl,imx23", |
@@ -508,7 +496,6 @@ static const char *mxs_dt_compat[] __initdata = { | |||
508 | 496 | ||
509 | DT_MACHINE_START(MXS, "Freescale MXS (Device Tree)") | 497 | DT_MACHINE_START(MXS, "Freescale MXS (Device Tree)") |
510 | .handle_irq = icoll_handle_irq, | 498 | .handle_irq = icoll_handle_irq, |
511 | .init_time = mxs_timer_init, | ||
512 | .init_machine = mxs_machine_init, | 499 | .init_machine = mxs_machine_init, |
513 | .init_late = mxs_pm_init, | 500 | .init_late = mxs_pm_init, |
514 | .dt_compat = mxs_dt_compat, | 501 | .dt_compat = mxs_dt_compat, |
diff --git a/drivers/clk/mxs/clk-imx23.c b/drivers/clk/mxs/clk-imx23.c index c396fe361589..9fc9359f5133 100644 --- a/drivers/clk/mxs/clk-imx23.c +++ b/drivers/clk/mxs/clk-imx23.c | |||
@@ -12,6 +12,7 @@ | |||
12 | #include <linux/clk.h> | 12 | #include <linux/clk.h> |
13 | #include <linux/clk/mxs.h> | 13 | #include <linux/clk/mxs.h> |
14 | #include <linux/clkdev.h> | 14 | #include <linux/clkdev.h> |
15 | #include <linux/clk-provider.h> | ||
15 | #include <linux/err.h> | 16 | #include <linux/err.h> |
16 | #include <linux/init.h> | 17 | #include <linux/init.h> |
17 | #include <linux/io.h> | 18 | #include <linux/io.h> |
@@ -100,16 +101,16 @@ static enum imx23_clk clks_init_on[] __initdata = { | |||
100 | cpu, hbus, xbus, emi, uart, | 101 | cpu, hbus, xbus, emi, uart, |
101 | }; | 102 | }; |
102 | 103 | ||
103 | int __init mx23_clocks_init(void) | 104 | static void __init mx23_clocks_init(struct device_node *np) |
104 | { | 105 | { |
105 | struct device_node *np; | 106 | struct device_node *dcnp; |
106 | u32 i; | 107 | u32 i; |
107 | 108 | ||
108 | np = of_find_compatible_node(NULL, NULL, "fsl,imx23-digctl"); | 109 | dcnp = of_find_compatible_node(NULL, NULL, "fsl,imx23-digctl"); |
109 | digctrl = of_iomap(np, 0); | 110 | digctrl = of_iomap(dcnp, 0); |
110 | WARN_ON(!digctrl); | 111 | WARN_ON(!digctrl); |
112 | of_node_put(dcnp); | ||
111 | 113 | ||
112 | np = of_find_compatible_node(NULL, NULL, "fsl,imx23-clkctrl"); | ||
113 | clkctrl = of_iomap(np, 0); | 114 | clkctrl = of_iomap(np, 0); |
114 | WARN_ON(!clkctrl); | 115 | WARN_ON(!clkctrl); |
115 | 116 | ||
@@ -162,7 +163,7 @@ int __init mx23_clocks_init(void) | |||
162 | if (IS_ERR(clks[i])) { | 163 | if (IS_ERR(clks[i])) { |
163 | pr_err("i.MX23 clk %d: register failed with %ld\n", | 164 | pr_err("i.MX23 clk %d: register failed with %ld\n", |
164 | i, PTR_ERR(clks[i])); | 165 | i, PTR_ERR(clks[i])); |
165 | return PTR_ERR(clks[i]); | 166 | return; |
166 | } | 167 | } |
167 | 168 | ||
168 | clk_data.clks = clks; | 169 | clk_data.clks = clks; |
@@ -172,5 +173,5 @@ int __init mx23_clocks_init(void) | |||
172 | for (i = 0; i < ARRAY_SIZE(clks_init_on); i++) | 173 | for (i = 0; i < ARRAY_SIZE(clks_init_on); i++) |
173 | clk_prepare_enable(clks[clks_init_on[i]]); | 174 | clk_prepare_enable(clks[clks_init_on[i]]); |
174 | 175 | ||
175 | return 0; | ||
176 | } | 176 | } |
177 | CLK_OF_DECLARE(imx23_clkctrl, "fsl,imx23-clkctrl", mx23_clocks_init); | ||
diff --git a/drivers/clk/mxs/clk-imx28.c b/drivers/clk/mxs/clk-imx28.c index 4faf0afc44cd..a6c35010e4e5 100644 --- a/drivers/clk/mxs/clk-imx28.c +++ b/drivers/clk/mxs/clk-imx28.c | |||
@@ -12,6 +12,7 @@ | |||
12 | #include <linux/clk.h> | 12 | #include <linux/clk.h> |
13 | #include <linux/clk/mxs.h> | 13 | #include <linux/clk/mxs.h> |
14 | #include <linux/clkdev.h> | 14 | #include <linux/clkdev.h> |
15 | #include <linux/clk-provider.h> | ||
15 | #include <linux/err.h> | 16 | #include <linux/err.h> |
16 | #include <linux/init.h> | 17 | #include <linux/init.h> |
17 | #include <linux/io.h> | 18 | #include <linux/io.h> |
@@ -154,16 +155,16 @@ static enum imx28_clk clks_init_on[] __initdata = { | |||
154 | cpu, hbus, xbus, emi, uart, | 155 | cpu, hbus, xbus, emi, uart, |
155 | }; | 156 | }; |
156 | 157 | ||
157 | int __init mx28_clocks_init(void) | 158 | static void __init mx28_clocks_init(struct device_node *np) |
158 | { | 159 | { |
159 | struct device_node *np; | 160 | struct device_node *dcnp; |
160 | u32 i; | 161 | u32 i; |
161 | 162 | ||
162 | np = of_find_compatible_node(NULL, NULL, "fsl,imx28-digctl"); | 163 | dcnp = of_find_compatible_node(NULL, NULL, "fsl,imx28-digctl"); |
163 | digctrl = of_iomap(np, 0); | 164 | digctrl = of_iomap(dcnp, 0); |
164 | WARN_ON(!digctrl); | 165 | WARN_ON(!digctrl); |
166 | of_node_put(dcnp); | ||
165 | 167 | ||
166 | np = of_find_compatible_node(NULL, NULL, "fsl,imx28-clkctrl"); | ||
167 | clkctrl = of_iomap(np, 0); | 168 | clkctrl = of_iomap(np, 0); |
168 | WARN_ON(!clkctrl); | 169 | WARN_ON(!clkctrl); |
169 | 170 | ||
@@ -239,7 +240,7 @@ int __init mx28_clocks_init(void) | |||
239 | if (IS_ERR(clks[i])) { | 240 | if (IS_ERR(clks[i])) { |
240 | pr_err("i.MX28 clk %d: register failed with %ld\n", | 241 | pr_err("i.MX28 clk %d: register failed with %ld\n", |
241 | i, PTR_ERR(clks[i])); | 242 | i, PTR_ERR(clks[i])); |
242 | return PTR_ERR(clks[i]); | 243 | return; |
243 | } | 244 | } |
244 | 245 | ||
245 | clk_data.clks = clks; | 246 | clk_data.clks = clks; |
@@ -250,6 +251,5 @@ int __init mx28_clocks_init(void) | |||
250 | 251 | ||
251 | for (i = 0; i < ARRAY_SIZE(clks_init_on); i++) | 252 | for (i = 0; i < ARRAY_SIZE(clks_init_on); i++) |
252 | clk_prepare_enable(clks[clks_init_on[i]]); | 253 | clk_prepare_enable(clks[clks_init_on[i]]); |
253 | |||
254 | return 0; | ||
255 | } | 254 | } |
255 | CLK_OF_DECLARE(imx28_clkctrl, "fsl,imx28-clkctrl", mx28_clocks_init); | ||
diff --git a/include/linux/clk/mxs.h b/include/linux/clk/mxs.h index 90c30dc3efc7..5138a90e018c 100644 --- a/include/linux/clk/mxs.h +++ b/include/linux/clk/mxs.h | |||
@@ -9,8 +9,6 @@ | |||
9 | #ifndef __LINUX_CLK_MXS_H | 9 | #ifndef __LINUX_CLK_MXS_H |
10 | #define __LINUX_CLK_MXS_H | 10 | #define __LINUX_CLK_MXS_H |
11 | 11 | ||
12 | int mx23_clocks_init(void); | ||
13 | int mx28_clocks_init(void); | ||
14 | int mxs_saif_clkmux_select(unsigned int clkmux); | 12 | int mxs_saif_clkmux_select(unsigned int clkmux); |
15 | 13 | ||
16 | #endif | 14 | #endif |