diff options
Diffstat (limited to 'kernel/drivers/clk/clk-gate.c')
-rw-r--r-- | kernel/drivers/clk/clk-gate.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/kernel/drivers/clk/clk-gate.c b/kernel/drivers/clk/clk-gate.c index 3f0e4200c..de0b322f5 100644 --- a/kernel/drivers/clk/clk-gate.c +++ b/kernel/drivers/clk/clk-gate.c @@ -52,6 +52,8 @@ static void clk_gate_endisable(struct clk_hw *hw, int enable) if (gate->lock) spin_lock_irqsave(gate->lock, flags); + else + __acquire(gate->lock); if (gate->flags & CLK_GATE_HIWORD_MASK) { reg = BIT(gate->bit_idx + 16); @@ -70,6 +72,8 @@ static void clk_gate_endisable(struct clk_hw *hw, int enable) if (gate->lock) spin_unlock_irqrestore(gate->lock, flags); + else + __release(gate->lock); } static int clk_gate_enable(struct clk_hw *hw) @@ -135,11 +139,9 @@ struct clk *clk_register_gate(struct device *dev, const char *name, } /* allocate the gate */ - gate = kzalloc(sizeof(struct clk_gate), GFP_KERNEL); - if (!gate) { - pr_err("%s: could not allocate gated clk\n", __func__); + gate = kzalloc(sizeof(*gate), GFP_KERNEL); + if (!gate) return ERR_PTR(-ENOMEM); - } init.name = name; init.ops = &clk_gate_ops; |