Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 295860
b: refs/heads/master
c: 0cdf3af
h: refs/heads/master
v: v3
  • Loading branch information
Minho Ban authored and Kukjin Kim committed Feb 11, 2012
1 parent 0aecb67 commit 775d6e5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8942ad89a059f9854ddf7223ca6e32869d7d9059
refs/heads/master: 0cdf3affd3ddf4ff1a88e32b89bc629d569793f3
12 changes: 8 additions & 4 deletions trunk/arch/arm/plat-samsung/clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,31 +84,35 @@ static int clk_null_enable(struct clk *clk, int enable)

int clk_enable(struct clk *clk)
{
unsigned long flags;

if (IS_ERR(clk) || clk == NULL)
return -EINVAL;

clk_enable(clk->parent);

spin_lock(&clocks_lock);
spin_lock_irqsave(&clocks_lock, flags);

if ((clk->usage++) == 0)
(clk->enable)(clk, 1);

spin_unlock(&clocks_lock);
spin_unlock_irqrestore(&clocks_lock, flags);
return 0;
}

void clk_disable(struct clk *clk)
{
unsigned long flags;

if (IS_ERR(clk) || clk == NULL)
return;

spin_lock(&clocks_lock);
spin_lock_irqsave(&clocks_lock, flags);

if ((--clk->usage) == 0)
(clk->enable)(clk, 0);

spin_unlock(&clocks_lock);
spin_unlock_irqrestore(&clocks_lock, flags);
clk_disable(clk->parent);
}

Expand Down

0 comments on commit 775d6e5

Please sign in to comment.