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>
This commit is contained in:
parent
e6c3e730a7
commit
3a64789568
3 changed files with 7 additions and 9 deletions
|
@ -1092,9 +1092,9 @@ static void __init exynos4_clk_init(struct device_node *np,
|
||||||
pr_info("%s clocks: sclk_apll = %ld, sclk_mpll = %ld\n"
|
pr_info("%s clocks: sclk_apll = %ld, sclk_mpll = %ld\n"
|
||||||
"\tsclk_epll = %ld, sclk_vpll = %ld, arm_clk = %ld\n",
|
"\tsclk_epll = %ld, sclk_vpll = %ld, arm_clk = %ld\n",
|
||||||
exynos4_soc == EXYNOS4210 ? "Exynos4210" : "Exynos4x12",
|
exynos4_soc == EXYNOS4210 ? "Exynos4210" : "Exynos4x12",
|
||||||
_get_rate("sclk_apll"), _get_rate("mout_mpll"),
|
_get_rate("sclk_apll"), _get_rate("sclk_mpll"),
|
||||||
_get_rate("sclk_epll"), _get_rate("sclk_vpll"),
|
_get_rate("sclk_epll"), _get_rate("sclk_vpll"),
|
||||||
_get_rate("armclk"));
|
_get_rate("arm_clk"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -132,7 +132,7 @@ static void __init exynos5440_clk_init(struct device_node *np)
|
||||||
samsung_clk_register_gate(exynos5440_gate_clks,
|
samsung_clk_register_gate(exynos5440_gate_clks,
|
||||||
ARRAY_SIZE(exynos5440_gate_clks));
|
ARRAY_SIZE(exynos5440_gate_clks));
|
||||||
|
|
||||||
pr_info("Exynos5440: arm_clk = %ldHz\n", _get_rate("armclk"));
|
pr_info("Exynos5440: arm_clk = %ldHz\n", _get_rate("arm_clk"));
|
||||||
pr_info("exynos5440 clock initialization complete\n");
|
pr_info("exynos5440 clock initialization complete\n");
|
||||||
}
|
}
|
||||||
CLK_OF_DECLARE(exynos5440_clk, "samsung,exynos5440-clock", exynos5440_clk_init);
|
CLK_OF_DECLARE(exynos5440_clk, "samsung,exynos5440-clock", exynos5440_clk_init);
|
||||||
|
|
|
@ -307,14 +307,12 @@ void __init samsung_clk_of_register_fixed_ext(
|
||||||
unsigned long _get_rate(const char *clk_name)
|
unsigned long _get_rate(const char *clk_name)
|
||||||
{
|
{
|
||||||
struct clk *clk;
|
struct clk *clk;
|
||||||
unsigned long rate;
|
|
||||||
|
|
||||||
clk = clk_get(NULL, clk_name);
|
clk = __clk_lookup(clk_name);
|
||||||
if (IS_ERR(clk)) {
|
if (!clk) {
|
||||||
pr_err("%s: could not find clock %s\n", __func__, clk_name);
|
pr_err("%s: could not find clock %s\n", __func__, clk_name);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
rate = clk_get_rate(clk);
|
|
||||||
clk_put(clk);
|
return clk_get_rate(clk);
|
||||||
return rate;
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue