Commit 0e8f6e49 authored by Masahiro Yamada's avatar Masahiro Yamada Committed by Stephen Boyd

clk: walk the orphan clock list more simply

This loop can be much simpler. If a new parent is available for
orphan clocks, __clk_init_parent(orphan) can detect it.
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 858d5881
...@@ -2422,23 +2422,14 @@ static int __clk_core_init(struct clk_core *core) ...@@ -2422,23 +2422,14 @@ static int __clk_core_init(struct clk_core *core)
core->rate = core->req_rate = rate; core->rate = core->req_rate = rate;
/* /*
* walk the list of orphan clocks and reparent any that are children of * walk the list of orphan clocks and reparent any that newly finds a
* this clock * parent.
*/ */
hlist_for_each_entry_safe(orphan, tmp2, &clk_orphan_list, child_node) { hlist_for_each_entry_safe(orphan, tmp2, &clk_orphan_list, child_node) {
if (orphan->num_parents && orphan->ops->get_parent) { struct clk_core *parent = __clk_init_parent(orphan);
i = orphan->ops->get_parent(orphan->hw);
if (i >= 0 && i < orphan->num_parents &&
!strcmp(core->name, orphan->parent_names[i]))
clk_core_reparent(orphan, core);
continue;
}
for (i = 0; i < orphan->num_parents; i++) if (parent)
if (!strcmp(core->name, orphan->parent_names[i])) { clk_core_reparent(orphan, parent);
clk_core_reparent(orphan, core);
break;
}
} }
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment