Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4526e7b8 authored by Stephen Boyd's avatar Stephen Boyd Committed by Michael Turquette
Browse files

clk: Skip fetching index for single parent clocks



We don't need to fetch the parent index for clocks if they only
have one parent. Doing this also avoid an unnecessary allocation
for the parent cache.

Signed-off-by: default avatarStephen Boyd <sboyd@codeaurora.org>
Signed-off-by: default avatarMichael Turquette <mturquette@linaro.org>
parent 2e9dcdae
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -1390,7 +1390,7 @@ static struct clk *clk_calc_new_rates(struct clk *clk, unsigned long rate)
	}
	}


	/* try finding the new parent index */
	/* try finding the new parent index */
	if (parent) {
	if (parent && clk->num_parents > 1) {
		p_index = clk_fetch_parent_index(clk, parent);
		p_index = clk_fetch_parent_index(clk, parent);
		if (p_index < 0) {
		if (p_index < 0) {
			pr_debug("%s: clk %s can not be parent of clk %s\n",
			pr_debug("%s: clk %s can not be parent of clk %s\n",