提交 88cfbef2 编写于 作者: M Masahiro Yamada 提交者: Stephen Boyd

clk: simplify clk_core_get_parent_by_index()

Drop the "if (!core->parents)" case and refactor the function a bit
because core->parents is always allocated.  (Strictly speaking, it is
ZERO_SIZE_PTR if core->num_parents == 0, but such a case is omitted
by the if-conditional above.)
Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: NVladimir Zapolskiy <vz@mleia.com>
Signed-off-by: NStephen Boyd <sboyd@codeaurora.org>
上级 176d1169
......@@ -350,13 +350,12 @@ static struct clk_core *clk_core_get_parent_by_index(struct clk_core *core,
{
if (!core || index >= core->num_parents)
return NULL;
else if (!core->parents)
return clk_core_lookup(core->parent_names[index]);
else if (!core->parents[index])
return core->parents[index] =
clk_core_lookup(core->parent_names[index]);
else
return core->parents[index];
if (!core->parents[index])
core->parents[index] =
clk_core_lookup(core->parent_names[index]);
return core->parents[index];
}
struct clk_hw *
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册