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: David Collins <collinsd@codeaurora.org>
This commit is contained in:
David Collins
2019-06-05 15:00:33 -07:00
parent c0835c6a9f
commit ff5ce501ba

View File

@@ -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) {