From: Jerome Brunet Date: Fri, 19 Jan 2018 15:55:24 +0000 (+0100) Subject: clk: meson: use the frac parameter width instead of a constant X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=4c5f67b7ea329ed8b3cf708fde4656b2d3b27dbf;p=linux.git clk: meson: use the frac parameter width instead of a constant Use the fractional part width in the calculation instead of 12, which happens to be the witdh right now. This is safer in case the field width ever change in the future Signed-off-by: Jerome Brunet --- diff --git a/drivers/clk/meson/clk-pll.c b/drivers/clk/meson/clk-pll.c index 087dfc532ba8a..50923d004d96e 100644 --- a/drivers/clk/meson/clk-pll.c +++ b/drivers/clk/meson/clk-pll.c @@ -81,7 +81,7 @@ static unsigned long meson_clk_pll_recalc_rate(struct clk_hw *hw, reg = readl(pll->base + p->reg_off); frac = PARM_GET(p->width, p->shift, reg); - rate += mul_u64_u32_shr(parent_rate, frac, 12); + rate += mul_u64_u32_shr(parent_rate, frac, p->width); rate *= 2; }