summaryrefslogtreecommitdiff
path: root/drivers/clk/clk.c
diff options
context:
space:
mode:
authorMasahiro Yamada <yamada.masahiro@socionext.com>2015-12-28 19:23:10 +0900
committerStephen Boyd <sboyd@codeaurora.org>2016-02-02 11:53:17 -0800
commite8f0e68ec0802dc840e29e0fabdcfdc39aa2a8fb (patch)
tree642e0e96e88080f6121fe4f26a68d3f4b411a15a /drivers/clk/clk.c
parent470b5e2f97cf8fb6a8375cc59e86314c9dd354c2 (diff)
downloadlinux-next-e8f0e68ec0802dc840e29e0fabdcfdc39aa2a8fb.tar.gz
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: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Vladimir Zapolskiy <vz@mleia.com> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Diffstat (limited to 'drivers/clk/clk.c')
-rw-r--r--drivers/clk/clk.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index 82b79a6ec0ec..d31ed95d27a4 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -1748,13 +1748,13 @@ static int clk_core_set_parent(struct clk_core *core, struct clk_core *parent)
/* try finding the new parent index */
if (parent) {
p_index = clk_fetch_parent_index(core, parent);
- p_rate = parent->rate;
if (p_index < 0) {
pr_debug("%s: clk %s can not be parent of clk %s\n",
__func__, parent->name, core->name);
ret = p_index;
goto out;
}
+ p_rate = parent->rate;
}
/* propagate PRE_RATE_CHANGE notifications */