Message ID | 1470999108-9851-4-git-send-email-keguang.zhang@gmail.com (mailing list archive) |
---|---|
State | Changes Requested, archived |
Delegated to: | Stephen Boyd |
Headers | show |
On 08/12, Keguang Zhang wrote: > From: Kelvin Cheung <keguang.zhang@gmail.com> > > Make use of GENMASK instead of open coding the equivalent operation, > and update the PLL formula. Was the old formula broken? I would expect a bug fix like this to be first in the series and be backported to any affected stable trees.
diff --git a/drivers/clk/loongson1/clk-loongson1b.c b/drivers/clk/loongson1/clk-loongson1b.c index 2302ee5..5cedb28 100644 --- a/drivers/clk/loongson1/clk-loongson1b.c +++ b/drivers/clk/loongson1/clk-loongson1b.c @@ -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;