summaryrefslogtreecommitdiff
path: root/drivers/clk/mmp
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/clk/mmp')
-rw-r--r--drivers/clk/mmp/clk-mix.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/clk/mmp/clk-mix.c b/drivers/clk/mmp/clk-mix.c
index 7a37432761f9..665cb6794639 100644
--- a/drivers/clk/mmp/clk-mix.c
+++ b/drivers/clk/mmp/clk-mix.c
@@ -218,7 +218,7 @@ static int mmp_clk_mix_determine_rate(struct clk_hw *hw,
parent = NULL;
mix_rate_best = 0;
parent_rate_best = 0;
- gap_best = req->rate;
+ gap_best = ULONG_MAX;
parent_best = NULL;
if (mix->table) {
@@ -262,6 +262,9 @@ static int mmp_clk_mix_determine_rate(struct clk_hw *hw,
}
found:
+ if (!parent_best)
+ return -EINVAL;
+
req->best_parent_rate = parent_rate_best;
req->best_parent_hw = __clk_get_hw(parent_best);
req->rate = mix_rate_best;