These changes are the raw update to linux-4.4.6-rt14. Kernel sources
[kvmfornfv.git] / kernel / drivers / clk / clk-gate.c
index 3f0e420..de0b322 100644 (file)
@@ -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;