@@ -70,12 +70,12 @@ const struct clk_ops clk_fixed_factor_op
};
EXPORT_SYMBOL_GPL(clk_fixed_factor_ops);
-struct clk *clk_register_fixed_factor(struct device *dev, const char *name,
- const char *parent_name, unsigned long flags,
- unsigned int mult, unsigned int div)
+struct clk *clk_register_fixed_factor_init(struct device *dev,
+ struct clk_init_data *init,
+ unsigned int mult,
+ unsigned int div)
{
struct clk_fixed_factor *fix;
- struct clk_init_data init = {};
struct clk *clk;
fix = kmalloc(sizeof(*fix), GFP_KERNEL);
@@ -85,13 +85,11 @@ struct clk *clk_register_fixed_factor(st
/* struct clk_fixed_factor assignments */
fix->mult = mult;
fix->div = div;
- fix->hw.init = &init;
+ fix->hw.init = init;
- init.name = name;
- init.ops = &clk_fixed_factor_ops;
- init.flags = flags | CLK_IS_BASIC;
- init.parent_names = &parent_name;
- init.num_parents = 1;
+ init->ops = &clk_fixed_factor_ops;
+ init->flags |= CLK_IS_BASIC;
+ init->num_parents = 1;
clk = clk_register(dev, &fix->hw);
@@ -100,6 +98,20 @@ struct clk *clk_register_fixed_factor(st
return clk;
}
+EXPORT_SYMBOL_GPL(clk_register_fixed_factor_init);
+
+struct clk *clk_register_fixed_factor(struct device *dev, const char *name,
+ const char *parent_name, unsigned long flags,
+ unsigned int mult, unsigned int div)
+{
+ struct clk_init_data init = {};
+
+ init.name = name;
+ init.flags = flags;
+ init.parent_names = &parent_name;
+
+ return clk_register_fixed_factor_init(dev, &init, mult, div);
+}
EXPORT_SYMBOL_GPL(clk_register_fixed_factor);
#ifdef CONFIG_OF
@@ -484,6 +484,10 @@ struct clk_fixed_factor {
};
extern const struct clk_ops clk_fixed_factor_ops;
+struct clk *clk_register_fixed_factor_init(struct device *dev,
+ struct clk_init_data *init,
+ unsigned int mult,
+ unsigned int div);
struct clk *clk_register_fixed_factor(struct device *dev, const char *name,
const char *parent_name, unsigned long flags,
unsigned int mult, unsigned int div);