msm: Consolidate set-up of 'children' lists in msm_clock_init()
Calling clk_set_parent(clk, clk_get_parent(clk)) worked but is confusing
to read since it's not obvious why it's necessary to re-set a parent to
something that already appears to be the parent.
Make this clear by moving the similar implementations for associating
children with their parent from clock-voter.c and clock-local.c into
msm_clock_init(), since there is no reason this code can't be
generic.
Change-Id: Ibb064fd1f1dfd0696cfa8e3e3056ebc461c90540
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
diff --git a/arch/arm/mach-msm/clock.c b/arch/arm/mach-msm/clock.c
index 4073a8d..dcded38 100644
--- a/arch/arm/mach-msm/clock.c
+++ b/arch/arm/mach-msm/clock.c
@@ -410,7 +410,8 @@
for (n = 0; n < num_clocks; n++) {
struct clk *clk = clock_tbl[n].clk;
struct clk *parent = clk_get_parent(clk);
- clk_set_parent(clk, parent);
+ if (parent && list_empty(&clk->siblings))
+ list_add(&clk->siblings, &parent->children);
if (clk->ops->handoff && !(clk->flags & CLKFLAG_HANDOFF_RATE)) {
if (clk->ops->handoff(clk) == HANDOFF_ENABLED_CLK) {
clk->flags |= CLKFLAG_HANDOFF_RATE;