Skip to content

Commit

Permalink
ARM: imx: lock is always valid for clk_gate2
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Shawn Guo committed May 12, 2014
1 parent 54ee147 commit 94b5c02
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions arch/arm/mach-imx/clk-gate2.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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)
Expand Down

0 comments on commit 94b5c02

Please sign in to comment.