diff options
author | Claudiu Beznea <claudiu.beznea@microchip.com> | 2020-07-22 09:38:09 +0200 |
---|---|---|
committer | Stephen Boyd <sboyd@kernel.org> | 2020-07-24 11:18:47 +0200 |
commit | 3a5c42b18a6ddc0de77dde017baf45262fbf1ced (patch) | |
tree | 48fed6100dfc276da8e6e2a671b282a6e2a92b47 /drivers/clk | |
parent | clk: at91: fix possible dead lock in new drivers (diff) | |
download | linux-3a5c42b18a6ddc0de77dde017baf45262fbf1ced.tar.xz linux-3a5c42b18a6ddc0de77dde017baf45262fbf1ced.zip |
clk: at91: clk-generated: continue if __clk_determine_rate() returns error
__clk_determine_rate() may return error. Skip the current step
in case of error.
Fixes: 1a1a36d72e3d3 ("clk: at91: clk-generated: make gclk determine audio_pll rate")
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-2-git-send-email-claudiu.beznea@microchip.com
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Diffstat (limited to 'drivers/clk')
-rw-r--r-- | drivers/clk/at91/clk-generated.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/clk/at91/clk-generated.c b/drivers/clk/at91/clk-generated.c index 44a46dcc0518..995a13133cfb 100644 --- a/drivers/clk/at91/clk-generated.c +++ b/drivers/clk/at91/clk-generated.c @@ -170,7 +170,8 @@ static int clk_generated_determine_rate(struct clk_hw *hw, for (div = 1; div < GENERATED_MAX_DIV + 2; div++) { req_parent.rate = req->rate * div; - __clk_determine_rate(parent, &req_parent); + if (__clk_determine_rate(parent, &req_parent)) + continue; clk_generated_best_diff(req, parent, req_parent.rate, div, &best_diff, &best_rate); |