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

clk: pistachio: Add a pll_lock() helper for clarity

This commit adds a pll_lock() helper making the code more readable.
Cosmetic change only, no functionality changes.

Signed-off-by: Andrew Bresticker <abrestic@chromium.org>
Signed-off-by: Ezequiel Garcia <ezequiel.garcia@imgtec.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>

authored by

Ezequiel Garcia and committed by
Stephen Boyd
4f4adfbf 24c65a02

+8 -4
+8 -4
drivers/clk/pistachio/clk-pll.c
··· 67 67 writel(val, pll->base + reg); 68 68 } 69 69 70 + static inline void pll_lock(struct pistachio_clk_pll *pll) 71 + { 72 + while (!(pll_readl(pll, PLL_STATUS) & PLL_STATUS_LOCK)) 73 + cpu_relax(); 74 + } 75 + 70 76 static inline u32 do_div_round_closest(u64 dividend, u32 divisor) 71 77 { 72 78 dividend += divisor / 2; ··· 184 178 (params->postdiv2 << PLL_FRAC_CTRL2_POSTDIV2_SHIFT); 185 179 pll_writel(pll, val, PLL_CTRL2); 186 180 187 - while (!(pll_readl(pll, PLL_STATUS) & PLL_STATUS_LOCK)) 188 - cpu_relax(); 181 + pll_lock(pll); 189 182 190 183 if (!was_enabled) 191 184 pll_gf40lp_frac_disable(hw); ··· 293 288 (params->postdiv2 << PLL_INT_CTRL1_POSTDIV2_SHIFT); 294 289 pll_writel(pll, val, PLL_CTRL1); 295 290 296 - while (!(pll_readl(pll, PLL_STATUS) & PLL_STATUS_LOCK)) 297 - cpu_relax(); 291 + pll_lock(pll); 298 292 299 293 if (!was_enabled) 300 294 pll_gf40lp_laint_disable(hw);