clk: simplify __clk_init_parent()
authorMasahiro Yamada <yamada.masahiro@socionext.com>
Mon, 28 Dec 2015 10:23:04 +0000 (19:23 +0900)
committerStephen Boyd <sboyd@codeaurora.org>
Tue, 2 Feb 2016 19:53:10 +0000 (11:53 -0800)
commit5146e0b05963f75347c9f4e18996da245f859e32
treedfd3f47d3f455d82f5eb741cf63595fd24d3189f
parent3c8e77dd20ab733f855e66bb6197ce84eb33e480
clk: simplify __clk_init_parent()

The translation from the index into clk_core is done by
clk_core_get_parent_by_index().  The if-block for num_parents == 1
case is duplicating the code in the clk_core_get_parent_by_index().

Drop the "if (num_parents == 1)" from the special case.  Instead,
set the index to zero if .get_parent() is missing.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Vladimir Zapolskiy <vz@mleia.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
drivers/clk/clk.c