From: Kelvin Cheung Date: Mon, 19 Sep 2016 04:38:56 +0000 (+0800) Subject: clk: Loongson1: Make use of GENMASK X-Git-Tag: Ubuntu-4.9.0-1.2~772^2~1 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=f0ffaf187addb5dcab76885fff9314b716fc8072;p=mirror_ubuntu-zesty-kernel.git clk: Loongson1: Make use of GENMASK Make use of GENMASK instead of open coding the equivalent operation, and update the PLL formula. Signed-off-by: Kelvin Cheung Signed-off-by: Stephen Boyd --- diff --git a/drivers/clk/loongson1/clk-loongson1b.c b/drivers/clk/loongson1/clk-loongson1b.c index 4b3d9d2983ee..f36a97e993c0 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;