Commit 83331bfc authored by Claudiu Beznea's avatar Claudiu Beznea Committed by Stephen Boyd
Browse files

clk: at91: clk-generated: check best_rate against ranges



Check best_rate against available clock ranges.

Fixes: df70aeef ("clk: at91: add generated clock driver")
Signed-off-by: default avatarClaudiu Beznea <claudiu.beznea@microchip.com>
Reviewed-by: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
Link: https://lore.kernel.org/r/1595403506-8209-3-git-send-email-claudiu.beznea@microchip.com


Signed-off-by: default avatarStephen Boyd <sboyd@kernel.org>
parent 3a5c42b1
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -185,8 +185,8 @@ end:
		 __clk_get_name((req->best_parent_hw)->clk),
		 req->best_parent_rate);

	if (best_rate < 0)
		return best_rate;
	if (best_rate < 0 || (gck->range.max && best_rate > gck->range.max))
		return -EINVAL;

	req->rate = best_rate;
	return 0;