@@ -8,6 +8,7 @@
* Standard functionality for the common clock API.
*/
#include <linux/module.h>
+#include <linux/clk.h>
#include <linux/clk-provider.h>
#include <linux/slab.h>
#include <linux/err.h>
@@ -120,10 +121,11 @@ EXPORT_SYMBOL_GPL(clk_register_fixed_fac
*/
void __init of_fixed_factor_clk_setup(struct device_node *node)
{
- struct clk *clk;
+ struct clk *clk, *parent;
const char *clk_name = node->name;
- const char *parent_name;
+ const char *parent_name = NULL;
u32 div, mult;
+ struct clk_init_data init = {};
if (of_property_read_u32(node, "clock-div", &div)) {
pr_err("%s Fixed factor clock <%s> must have a clock-div property\n",
@@ -138,10 +140,14 @@ void __init of_fixed_factor_clk_setup(st
}
of_property_read_string(node, "clock-output-names", &clk_name);
- parent_name = of_clk_get_parent_name(node, 0);
+ parent = of_clk_get(node, 0);
+
+ init.name = clk_name;
+ init.parents = &parent;
+ init.parent_names = &parent_name;
+
+ clk = clk_register_fixed_factor_init(NULL, &init, mult, div);
- clk = clk_register_fixed_factor(NULL, clk_name, parent_name, 0,
- mult, div);
if (!IS_ERR(clk))
of_clk_add_provider(node, of_clk_src_simple_get, clk);
}