Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 741e96e8 authored by Nicolas Pitre's avatar Nicolas Pitre Committed by Stephen Boyd
Browse files

imx/clk-pllv1: fix wrong do_div() usage



do_div() is meant to be used with an unsigned dividend.

Signed-off-by: default avatarNicolas Pitre <nico@linaro.org>
Acked-by: default avatarShawn Guo <shawnguo@kernel.org>
Signed-off-by: default avatarStephen Boyd <sboyd@codeaurora.org>
parent c6bb9cec
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -52,7 +52,7 @@ static unsigned long clk_pllv1_recalc_rate(struct clk_hw *hw,
		unsigned long parent_rate)
{
	struct clk_pllv1 *pll = to_clk_pllv1(hw);
	long long ll;
	unsigned long long ull;
	int mfn_abs;
	unsigned int mfi, mfn, mfd, pd;
	u32 reg;
@@ -94,16 +94,16 @@ static unsigned long clk_pllv1_recalc_rate(struct clk_hw *hw,
	rate = parent_rate * 2;
	rate /= pd + 1;

	ll = (unsigned long long)rate * mfn_abs;
	ull = (unsigned long long)rate * mfn_abs;

	do_div(ll, mfd + 1);
	do_div(ull, mfd + 1);

	if (mfn_is_negative(pll, mfn))
		ll = -ll;

	ll = (rate * mfi) + ll;
		ull = (rate * mfi) - ull;
	else
		ull = (rate * mfi) + ull;

	return ll;
	return ull;
}

static struct clk_ops clk_pllv1_ops = {