diff options
author | Tomasz Figa <t.figa@samsung.com> | 2013-08-26 13:09:00 -0400 |
---|---|---|
committer | Mike Turquette <mturquette@linaro.org> | 2013-09-06 16:33:15 -0400 |
commit | 3a64789568f5f8afdc09fb33764f2ecbb72fb817 (patch) | |
tree | 224b480f84ab14a17848c382e020834dc0532cb2 /drivers/clk | |
parent | e6c3e730a75faee17ebbf3220c00e3039ab49f53 (diff) |
clk: samsung: Modify _get_rate() helper to use __clk_lookup()
There is no need to use clkdev inside the clock driver to retrieve the
clocks for internal use. Instead __clk_lookup() helper can be used to
look up clocks by their platform name.
This patch modifies the behavior of _get_rate() helper to look up clocks
by platform name and adjusts all users of it to pass platform names
instead of clkdev aliases.
Signed-off-by: Tomasz Figa <t.figa@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mike Turquette <mturquette@linaro.org>
Diffstat (limited to 'drivers/clk')
-rw-r--r-- | drivers/clk/samsung/clk-exynos4.c | 4 | ||||
-rw-r--r-- | drivers/clk/samsung/clk-exynos5440.c | 2 | ||||
-rw-r--r-- | drivers/clk/samsung/clk.c | 10 |
3 files changed, 7 insertions, 9 deletions
diff --git a/drivers/clk/samsung/clk-exynos4.c b/drivers/clk/samsung/clk-exynos4.c index d70d3cbaacfe..cf7afde6e758 100644 --- a/drivers/clk/samsung/clk-exynos4.c +++ b/drivers/clk/samsung/clk-exynos4.c | |||
@@ -1092,9 +1092,9 @@ static void __init exynos4_clk_init(struct device_node *np, | |||
1092 | pr_info("%s clocks: sclk_apll = %ld, sclk_mpll = %ld\n" | 1092 | pr_info("%s clocks: sclk_apll = %ld, sclk_mpll = %ld\n" |
1093 | "\tsclk_epll = %ld, sclk_vpll = %ld, arm_clk = %ld\n", | 1093 | "\tsclk_epll = %ld, sclk_vpll = %ld, arm_clk = %ld\n", |
1094 | exynos4_soc == EXYNOS4210 ? "Exynos4210" : "Exynos4x12", | 1094 | exynos4_soc == EXYNOS4210 ? "Exynos4210" : "Exynos4x12", |
1095 | _get_rate("sclk_apll"), _get_rate("mout_mpll"), | 1095 | _get_rate("sclk_apll"), _get_rate("sclk_mpll"), |
1096 | _get_rate("sclk_epll"), _get_rate("sclk_vpll"), | 1096 | _get_rate("sclk_epll"), _get_rate("sclk_vpll"), |
1097 | _get_rate("armclk")); | 1097 | _get_rate("arm_clk")); |
1098 | } | 1098 | } |
1099 | 1099 | ||
1100 | 1100 | ||
diff --git a/drivers/clk/samsung/clk-exynos5440.c b/drivers/clk/samsung/clk-exynos5440.c index 4ef38e045e39..f8658945bfd2 100644 --- a/drivers/clk/samsung/clk-exynos5440.c +++ b/drivers/clk/samsung/clk-exynos5440.c | |||
@@ -132,7 +132,7 @@ static void __init exynos5440_clk_init(struct device_node *np) | |||
132 | samsung_clk_register_gate(exynos5440_gate_clks, | 132 | samsung_clk_register_gate(exynos5440_gate_clks, |
133 | ARRAY_SIZE(exynos5440_gate_clks)); | 133 | ARRAY_SIZE(exynos5440_gate_clks)); |
134 | 134 | ||
135 | pr_info("Exynos5440: arm_clk = %ldHz\n", _get_rate("armclk")); | 135 | pr_info("Exynos5440: arm_clk = %ldHz\n", _get_rate("arm_clk")); |
136 | pr_info("exynos5440 clock initialization complete\n"); | 136 | pr_info("exynos5440 clock initialization complete\n"); |
137 | } | 137 | } |
138 | CLK_OF_DECLARE(exynos5440_clk, "samsung,exynos5440-clock", exynos5440_clk_init); | 138 | CLK_OF_DECLARE(exynos5440_clk, "samsung,exynos5440-clock", exynos5440_clk_init); |
diff --git a/drivers/clk/samsung/clk.c b/drivers/clk/samsung/clk.c index cd3c40ab50f3..f503f32e2f80 100644 --- a/drivers/clk/samsung/clk.c +++ b/drivers/clk/samsung/clk.c | |||
@@ -307,14 +307,12 @@ void __init samsung_clk_of_register_fixed_ext( | |||
307 | unsigned long _get_rate(const char *clk_name) | 307 | unsigned long _get_rate(const char *clk_name) |
308 | { | 308 | { |
309 | struct clk *clk; | 309 | struct clk *clk; |
310 | unsigned long rate; | ||
311 | 310 | ||
312 | clk = clk_get(NULL, clk_name); | 311 | clk = __clk_lookup(clk_name); |
313 | if (IS_ERR(clk)) { | 312 | if (!clk) { |
314 | pr_err("%s: could not find clock %s\n", __func__, clk_name); | 313 | pr_err("%s: could not find clock %s\n", __func__, clk_name); |
315 | return 0; | 314 | return 0; |
316 | } | 315 | } |
317 | rate = clk_get_rate(clk); | 316 | |
318 | clk_put(clk); | 317 | return clk_get_rate(clk); |
319 | return rate; | ||
320 | } | 318 | } |