diff options
author | Mike Turquette <mturquette@linaro.org> | 2014-09-17 11:47:56 -0700 |
---|---|---|
committer | Mike Turquette <mturquette@linaro.org> | 2014-09-17 11:47:56 -0700 |
commit | a52ae5a755d980e9ff812c6f45a415ba27bfd33b (patch) | |
tree | a0a95f52e029aca5fb855fff2cb44661a80297ac /drivers/clk/clk.c | |
parent | 0469a43bc32001e63092df87c2d1fdf588ea7b3a (diff) | |
parent | 8ce8ebeb572d70e672a8d158e93ffaac80ea7576 (diff) |
Merge branch 'clk-fixes' into clk-next
Diffstat (limited to 'drivers/clk/clk.c')
-rw-r--r-- | drivers/clk/clk.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c index 8ca28189e4e9..52d58279a612 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c @@ -1449,6 +1449,7 @@ static struct clk *clk_propagate_rate_change(struct clk *clk, unsigned long even static void clk_change_rate(struct clk *clk) { struct clk *child; + struct hlist_node *tmp; unsigned long old_rate; unsigned long best_parent_rate = 0; bool skip_set_rate = false; @@ -1484,7 +1485,11 @@ static void clk_change_rate(struct clk *clk) if (clk->notifier_count && old_rate != clk->rate) __clk_notify(clk, POST_RATE_CHANGE, old_rate, clk->rate); - hlist_for_each_entry(child, &clk->children, child_node) { + /* + * Use safe iteration, as change_rate can actually swap parents + * for certain clock types. + */ + hlist_for_each_entry_safe(child, tmp, &clk->children, child_node) { /* Skip children who will be reparented to another clock */ if (child->new_parent && child->new_parent != clk) continue; |