|
@@ -579,14 +579,9 @@ clk_stm32_register_gate_ops(struct device *dev,
|
|
spinlock_t *lock)
|
|
spinlock_t *lock)
|
|
{
|
|
{
|
|
struct clk_init_data init = { NULL };
|
|
struct clk_init_data init = { NULL };
|
|
- struct clk_gate *gate;
|
|
|
|
struct clk_hw *hw;
|
|
struct clk_hw *hw;
|
|
int ret;
|
|
int ret;
|
|
|
|
|
|
- gate = kzalloc(sizeof(*gate), GFP_KERNEL);
|
|
|
|
- if (!gate)
|
|
|
|
- return ERR_PTR(-ENOMEM);
|
|
|
|
-
|
|
|
|
init.name = name;
|
|
init.name = name;
|
|
init.parent_names = &parent_name;
|
|
init.parent_names = &parent_name;
|
|
init.num_parents = 1;
|
|
init.num_parents = 1;
|
|
@@ -604,10 +599,8 @@ clk_stm32_register_gate_ops(struct device *dev,
|
|
hw->init = &init;
|
|
hw->init = &init;
|
|
|
|
|
|
ret = clk_hw_register(dev, hw);
|
|
ret = clk_hw_register(dev, hw);
|
|
- if (ret) {
|
|
|
|
- kfree(gate);
|
|
|
|
|
|
+ if (ret)
|
|
hw = ERR_PTR(ret);
|
|
hw = ERR_PTR(ret);
|
|
- }
|
|
|
|
|
|
|
|
return hw;
|
|
return hw;
|
|
}
|
|
}
|