ARM: imx: lock is always valid for clk_gate2
authorShawn Guo <shawn.guo@freescale.com>
Fri, 18 Apr 2014 08:07:44 +0000 (16:07 +0800)
committerShawn Guo <shawn.guo@freescale.com>
Mon, 12 May 2014 14:58:48 +0000 (22:58 +0800)
The imx specific clk_gate2 always has a valid lock with the clock.  So
the validation on gate->lock is not really needed.  Remove it.

Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
arch/arm/mach-imx/clk-gate2.c

index 7e98ccb8fa915985f7cfdc6c00ec2e94b17c3dce..0803df9d9c7e1846c88462aaa0219ef401cd22b8 100644 (file)
@@ -43,15 +43,13 @@ static int clk_gate2_enable(struct clk_hw *hw)
        u32 reg;
        unsigned long flags = 0;
 
-       if (gate->lock)
-               spin_lock_irqsave(gate->lock, flags);
+       spin_lock_irqsave(gate->lock, flags);
 
        reg = readl(gate->reg);
        reg |= 3 << gate->bit_idx;
        writel(reg, gate->reg);
 
-       if (gate->lock)
-               spin_unlock_irqrestore(gate->lock, flags);
+       spin_unlock_irqrestore(gate->lock, flags);
 
        return 0;
 }
@@ -62,15 +60,13 @@ static void clk_gate2_disable(struct clk_hw *hw)
        u32 reg;
        unsigned long flags = 0;
 
-       if (gate->lock)
-               spin_lock_irqsave(gate->lock, flags);
+       spin_lock_irqsave(gate->lock, flags);
 
        reg = readl(gate->reg);
        reg &= ~(3 << gate->bit_idx);
        writel(reg, gate->reg);
 
-       if (gate->lock)
-               spin_unlock_irqrestore(gate->lock, flags);
+       spin_unlock_irqrestore(gate->lock, flags);
 }
 
 static int clk_gate2_is_enabled(struct clk_hw *hw)