Skip to content

Commit

Permalink
clk: clk-fixed-factor: Clear OF_POPULATED flag in case of failure
Browse files Browse the repository at this point in the history
Fixed factor clock has two initializations at of_clk_init() time
and during platform driver probe. Before of_clk_init() call,
node is marked as populated and so its probe never gets called.

During of_clk_init() fixed factor clock registration may fail if
any of its parent clock is not registered. In this case, it doesn't
get chance to retry registration from probe. Clear OF_POPULATED
flag if fixed factor clock registration fails so that clock
registration is attempted again from probe.

Signed-off-by: Rajan Vaja <rajan.vaja@xilinx.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
  • Loading branch information
Rajan Vaja authored and Stephen Boyd committed Jul 25, 2018
1 parent ce397d2 commit f6dab42
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion drivers/clk/clk-fixed-factor.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,15 @@ static struct clk *_of_fixed_factor_clk_setup(struct device_node *node)

clk = clk_register_fixed_factor(NULL, clk_name, parent_name, flags,
mult, div);
if (IS_ERR(clk))
if (IS_ERR(clk)) {
/*
* If parent clock is not registered, registration would fail.
* Clear OF_POPULATED flag so that clock registration can be
* attempted again from probe function.
*/
of_node_clear_flag(node, OF_POPULATED);
return clk;
}

ret = of_clk_add_provider(node, of_clk_src_simple_get, clk);
if (ret) {
Expand Down

0 comments on commit f6dab42

Please sign in to comment.