diff options
author | Stephen Boyd <sboyd@codeaurora.org> | 2016-11-01 17:12:29 -0700 |
---|---|---|
committer | Stephen Boyd <sboyd@codeaurora.org> | 2016-11-01 17:12:29 -0700 |
commit | 0f1e2f891a8eb25513add7411be4f0960846146f (patch) | |
tree | 6fb26f21c3e48671848b8ed1cfab3b66bc105b4f /drivers/clk/imx/clk-pllv3.c | |
parent | a064a07f72e92cae31cb09c5734ec3c4edd52f47 (diff) | |
parent | c7129375312732f006ba9054c12ae4d4097d5519 (diff) | |
download | linux-0f1e2f891a8eb25513add7411be4f0960846146f.tar.bz2 |
Merge branch 'clk-fixes' into clk-next
* clk-fixes:
clk: imx: fix integer overflow in AV PLL round rate
clk: xgene: Don't call __pa on ioremaped address
clk: rockchip: don't return NULL when failing to register ddrclk branch
Diffstat (limited to 'drivers/clk/imx/clk-pllv3.c')
-rw-r--r-- | drivers/clk/imx/clk-pllv3.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/clk/imx/clk-pllv3.c b/drivers/clk/imx/clk-pllv3.c index 19f9b622981a..7a6acc3e4a92 100644 --- a/drivers/clk/imx/clk-pllv3.c +++ b/drivers/clk/imx/clk-pllv3.c @@ -223,7 +223,7 @@ static unsigned long clk_pllv3_av_recalc_rate(struct clk_hw *hw, temp64 *= mfn; do_div(temp64, mfd); - return (parent_rate * div) + (u32)temp64; + return parent_rate * div + (unsigned long)temp64; } static long clk_pllv3_av_round_rate(struct clk_hw *hw, unsigned long rate, @@ -247,7 +247,11 @@ static long clk_pllv3_av_round_rate(struct clk_hw *hw, unsigned long rate, do_div(temp64, parent_rate); mfn = temp64; - return parent_rate * div + parent_rate * mfn / mfd; + temp64 = (u64)parent_rate; + temp64 *= mfn; + do_div(temp64, mfd); + + return parent_rate * div + (unsigned long)temp64; } static int clk_pllv3_av_set_rate(struct clk_hw *hw, unsigned long rate, |