mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-15 08:14:15 +08:00
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: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Vladimir Zapolskiy <vz@mleia.com> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
This commit is contained in:
parent
858d588156
commit
0e8f6e499e
@ -2422,24 +2422,15 @@ 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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* optional platform-specific magic
|
* optional platform-specific magic
|
||||||
|
Loading…
Reference in New Issue
Block a user