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

Commit e8f0e68e authored by Masahiro Yamada's avatar Masahiro Yamada Committed by Stephen Boyd
Browse files

clk: slightly optimize clk_core_set_parent()



If clk_fetch_parent_index() fails, p_rate is unused.  Move the
assignment after the error checking.

Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: default avatarVladimir Zapolskiy <vz@mleia.com>
Signed-off-by: default avatarStephen Boyd <sboyd@codeaurora.org>
parent 470b5e2f
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -1748,13 +1748,13 @@ static int clk_core_set_parent(struct clk_core *core, struct clk_core *parent)
	/* try finding the new parent index */
	/* try finding the new parent index */
	if (parent) {
	if (parent) {
		p_index = clk_fetch_parent_index(core, parent);
		p_index = clk_fetch_parent_index(core, parent);
		p_rate = parent->rate;
		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",
					__func__, parent->name, core->name);
					__func__, parent->name, core->name);
			ret = p_index;
			ret = p_index;
			goto out;
			goto out;
		}
		}
		p_rate = parent->rate;
	}
	}


	/* propagate PRE_RATE_CHANGE notifications */
	/* propagate PRE_RATE_CHANGE notifications */