Skip to content

Commit

Permalink
clk: meson: use the frac parameter width instead of a constant
Browse files Browse the repository at this point in the history
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 <jbrunet@baylibre.com>
  • Loading branch information
Jerome Brunet committed Feb 12, 2018
1 parent 94aa8a4 commit 4c5f67b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/clk/meson/clk-pll.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 4c5f67b

Please sign in to comment.