[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20181130131753.7108e52a@canb.auug.org.au>
Date: Fri, 30 Nov 2018 13:17:53 +1100
From: Stephen Rothwell <sfr@...b.auug.org.au>
To: Abel Vesa <abel.vesa@....com>
Cc: Stephen Boyd <sboyd@...nel.org>,
Lucas Stach <l.stach@...gutronix.de>,
Michael Turquette <mturquette@...libre.com>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Linux Next Mailing List <linux-next@...r.kernel.org>,
Abel Vesa <abelvesa@...ux.com>,
dl-linux-imx <linux-imx@....com>
Subject: Re: [PATCH] clk: imx: Use do_div in SCCG due to 64-bit divisor
Hi Abel,
On Thu, 29 Nov 2018 23:50:22 +0000 Abel Vesa <abel.vesa@....com> wrote:
>
> --- a/drivers/clk/imx/clk-frac-pll.c
> +++ b/drivers/clk/imx/clk-frac-pll.c
> @@ -116,12 +116,13 @@ static long clk_pll_round_rate(struct clk_hw *hw, unsigned long rate,
> unsigned long *prate)
> {
> u64 parent_rate = *prate;
> - u32 divff, divfi;
> - u64 temp64;
> + u64 divff, divfi;
> + u64 temp64 = rate;
>
> parent_rate *= 8;
> rate *= 2;
> - divfi = rate / parent_rate;
> + do_div(temp64, parent_rate);
> + divfi = temp64;
Did you mean to lose the doubling of "rate" above?
--
Cheers,
Stephen Rothwell
Content of type "application/pgp-signature" skipped
Powered by blists - more mailing lists