mirror of https://gitee.com/openkylin/linux.git
clk: at91: clk-generated: check best_rate against ranges
Check best_rate against available clock ranges.
Fixes: df70aeef60
("clk: at91: add generated clock driver")
Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Reviewed-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Link: https://lore.kernel.org/r/1595403506-8209-3-git-send-email-claudiu.beznea@microchip.com
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
This commit is contained in:
parent
3a5c42b18a
commit
83331bfcc0
|
@ -185,8 +185,8 @@ static int clk_generated_determine_rate(struct clk_hw *hw,
|
|||
__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;
|
||||
|
|
Loading…
Reference in New Issue