Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

clk: clk-fixed-factor: Clear OF_POPULATED flag in case of failure

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>

authored by

Rajan Vaja and committed by
Stephen Boyd
f6dab423 ce397d21

+8 -1
+8 -1
drivers/clk/clk-fixed-factor.c
··· 177 177 178 178 clk = clk_register_fixed_factor(NULL, clk_name, parent_name, flags, 179 179 mult, div); 180 - if (IS_ERR(clk)) 180 + if (IS_ERR(clk)) { 181 + /* 182 + * If parent clock is not registered, registration would fail. 183 + * Clear OF_POPULATED flag so that clock registration can be 184 + * attempted again from probe function. 185 + */ 186 + of_node_clear_flag(node, OF_POPULATED); 181 187 return clk; 188 + } 182 189 183 190 ret = of_clk_add_provider(node, of_clk_src_simple_get, clk); 184 191 if (ret) {