Skip to content

Commit f99b3fe

Browse files
krzkbebarino
authored andcommitted
clk: samsung: fix getting Exynos4 fin_pll rate from external clocks
Commit 0dc83ad ("clk: samsung: Don't register clkdev lookup for the fixed rate clocks") claimed registering clkdev lookup is not necessary anymore, but that was not entirely true: Exynos4210/4212/4412 clock code still relied on it to get the clock rate of xxti or xusbxti external clocks. Drop that requirement by accessing already registered clk_hw when looking up the xxti/xusbxti rate. Reported-by: Artur Weber <[email protected]> Closes: https://lore.kernel.org/all/[email protected]/ Fixes: 0dc83ad ("clk: samsung: Don't register clkdev lookup for the fixed rate clocks") Cc: <[email protected]> Signed-off-by: Krzysztof Kozlowski <[email protected]> Link: https://lore.kernel.org/r/[email protected] Tested-by: Artur Weber <[email protected]> # Exynos4212 Signed-off-by: Stephen Boyd <[email protected]>
1 parent 0e91ac7 commit f99b3fe

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

drivers/clk/samsung/clk-exynos4.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1040,19 +1040,20 @@ static unsigned long __init exynos4_get_xom(void)
10401040
static void __init exynos4_clk_register_finpll(struct samsung_clk_provider *ctx)
10411041
{
10421042
struct samsung_fixed_rate_clock fclk;
1043-
struct clk *clk;
1044-
unsigned long finpll_f = 24000000;
1043+
unsigned long finpll_f;
1044+
unsigned int parent;
10451045
char *parent_name;
10461046
unsigned int xom = exynos4_get_xom();
10471047

10481048
parent_name = xom & 1 ? "xusbxti" : "xxti";
1049-
clk = clk_get(NULL, parent_name);
1050-
if (IS_ERR(clk)) {
1049+
parent = xom & 1 ? CLK_XUSBXTI : CLK_XXTI;
1050+
1051+
finpll_f = clk_hw_get_rate(ctx->clk_data.hws[parent]);
1052+
if (!finpll_f) {
10511053
pr_err("%s: failed to lookup parent clock %s, assuming "
10521054
"fin_pll clock frequency is 24MHz\n", __func__,
10531055
parent_name);
1054-
} else {
1055-
finpll_f = clk_get_rate(clk);
1056+
finpll_f = 24000000;
10561057
}
10571058

10581059
fclk.id = CLK_FIN_PLL;

0 commit comments

Comments
 (0)