mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-11-30 15:53:22 -05:00
clk: at91: clk-generated: Limit the requested rate to our range
[ Upstream commit af7651e67b9d5f7e63ea23b118e3672ac662244a ]
On clk_generated_determine_rate(), the requested rate could be outside
of clk's range. Limit the rate to the clock's range to not return an
error.
Fixes: df70aeef60 ("clk: at91: add generated clock driver")
Signed-off-by: Codrin Ciubotariu <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Acked-by: Nicolas Ferre <[email protected]>
Signed-off-by: Stephen Boyd <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
This commit is contained in:
parent
557f6445e3
commit
e46ce5a8ab
1 changed files with 6 additions and 0 deletions
|
|
@ -127,6 +127,12 @@ static int clk_generated_determine_rate(struct clk_hw *hw,
|
|||
int i;
|
||||
u32 div;
|
||||
|
||||
/* do not look for a rate that is outside of our range */
|
||||
if (gck->range.max && req->rate > gck->range.max)
|
||||
req->rate = gck->range.max;
|
||||
if (gck->range.min && req->rate < gck->range.min)
|
||||
req->rate = gck->range.min;
|
||||
|
||||
for (i = 0; i < clk_hw_get_num_parents(hw); i++) {
|
||||
if (gck->chg_pid == i)
|
||||
continue;
|
||||
|
|
|
|||
Loading…
Reference in a new issue