@@ -268,14 +268,8 @@ static struct clk_hw *_of_fixed_factor_clk_setup(struct device_node *node)
hw = __clk_hw_register_fixed_factor(NULL, node, clk_name, NULL, NULL, 0,
0, mult, div, false);
- if (IS_ERR(hw)) {
- /*
- * Clear OF_POPULATED flag so that clock registration can be
- * attempted again from probe function.
- */
- of_node_clear_flag(node, OF_POPULATED);
+ if (IS_ERR(hw))
return ERR_CAST(hw);
- }
ret = of_clk_add_hw_provider(node, of_clk_hw_simple_get, hw);
if (ret) {
@@ -292,7 +286,16 @@ static struct clk_hw *_of_fixed_factor_clk_setup(struct device_node *node)
*/
void __init of_fixed_factor_clk_setup(struct device_node *node)
{
- _of_fixed_factor_clk_setup(node);
+ struct clk_hw *hw;
+
+ hw = _of_fixed_factor_clk_setup(node);
+ if (IS_ERR(hw)) {
+ /*
+ * Clear OF_POPULATED flag so that clock registration can be
+ * attempted again from probe function.
+ */
+ of_node_clear_flag(node, OF_POPULATED);
+ }
}
CLK_OF_DECLARE(fixed_factor_clk, "fixed-factor-clock",
of_fixed_factor_clk_setup);
@@ -192,7 +192,16 @@ static struct clk_hw *_of_fixed_clk_setup(struct device_node *node)
*/
void __init of_fixed_clk_setup(struct device_node *node)
{
- _of_fixed_clk_setup(node);
+ struct clk_hw *hw;
+
+ hw = _of_fixed_clk_setup(node);
+ if (IS_ERR(hw)) {
+ /*
+ * Clear OF_POPULATED flag so that clock registration can be
+ * attempted again from probe function.
+ */
+ of_node_clear_flag(node, OF_POPULATED);
+ }
}
CLK_OF_DECLARE(fixed_clk, "fixed-clock", of_fixed_clk_setup);