Skip to content

Commit

Permalink
clk: Loongson1: Make use of GENMASK
Browse files Browse the repository at this point in the history
Make use of GENMASK instead of open coding the equivalent operation,
and update the PLL formula.

Signed-off-by: Kelvin Cheung <keguang.zhang@gmail.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
  • Loading branch information
Kelvin Cheung authored and Stephen Boyd committed Sep 23, 2016
1 parent c99c7a9 commit f0ffaf1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/clk/loongson1/clk-loongson1b.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ static unsigned long ls1x_pll_recalc_rate(struct clk_hw *hw,
u32 pll, rate;

pll = __raw_readl(LS1X_CLK_PLL_FREQ);
rate = 12 + (pll & 0x3f) + (((pll >> 8) & 0x3ff) >> 10);
rate = 12 + (pll & GENMASK(5, 0));
rate *= OSC;
rate >>= 1;

Expand Down

0 comments on commit f0ffaf1

Please sign in to comment.