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

Commit ff5ce501 authored by David Collins's avatar David Collins
Browse files

clk: do not vote for vdd_class level with 0 Hz rate_max



Inside of the clk_find_vdd_level() function when searching for
the vdd_class level associated with a given clock frequency,
ignore levels which have rate_max[] of 0 Hz.  This ensures that
the lowest non-OFF level is requested for uninitialized clock
rates of 0 Hz.

Change-Id: I83ed8564087728bd2854087f2e45f83319c6eb92
Signed-off-by: default avatarDavid Collins <collinsd@codeaurora.org>
parent c0835c6a
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -606,7 +606,8 @@ static int clk_find_vdd_level(struct clk_core *clk, unsigned long rate)
	 */
	for (level = 0; level < clk->num_rate_max; level++)
		if (DIV_ROUND_CLOSEST(rate, 1000) <=
				DIV_ROUND_CLOSEST(clk->rate_max[level], 1000))
				DIV_ROUND_CLOSEST(clk->rate_max[level], 1000) &&
		    clk->rate_max[level] > 0)
			break;

	if (level == clk->num_rate_max) {