summaryrefslogtreecommitdiff
path: root/drivers/clk/meson/clk-pll.c
diff options
context:
space:
mode:
authorJerome Brunet <jbrunet@baylibre.com>2018-01-19 16:55:24 +0100
committerJerome Brunet <jbrunet@baylibre.com>2018-02-12 09:49:23 +0100
commit4c5f67b7ea329ed8b3cf708fde4656b2d3b27dbf (patch)
treef989beea1abae68e375ccfe0a141290cdb5f55b3 /drivers/clk/meson/clk-pll.c
parent94aa8a41f1bc807db78567e7031d75998c166150 (diff)
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 <jbrunet@baylibre.com>
Diffstat (limited to 'drivers/clk/meson/clk-pll.c')
-rw-r--r--drivers/clk/meson/clk-pll.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/clk/meson/clk-pll.c b/drivers/clk/meson/clk-pll.c
index 087dfc532ba8..50923d004d96 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;
}