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

Commit 9a1f3460 authored by Taniya Das's avatar Taniya Das Committed by Gerrit - the friendly Code Review server
Browse files

clk: qcom: clock-generic: Use DIV_ROUND_CLOSEST for div clock



The current div value gets truncated and we are not able to achieve the
correct rate, instead use DIV_ROUND_CLOSEST to get the accurate div value.

CRs-Fixed: 754613
Change-Id: Ifa8ec3af39d2c7af9314d2d01ed625578df3375c
Signed-off-by: default avatarTaniya Das <tdas@codeaurora.org>
parent 53b0db65
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -480,7 +480,7 @@ static long __slave_div_round_rate(struct clk *c, unsigned long rate,
	max_div = d->data.max_div;

	p_rate = clk_get_rate(c->parent);
	div = p_rate / rate;
	div = DIV_ROUND_CLOSEST(p_rate, rate);
	div = max(div, min_div);
	div = min(div, max_div);
	if (best_div)