Skip to content

Commit

Permalink
Merge branch 'v3.6-samsung-fixes-3' of git://git.kernel.org/pub/scm/l…
Browse files Browse the repository at this point in the history
…inux/kernel/git/kgene/linux-samsung into fixes

* 'v3.6-samsung-fixes-3' of git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung:
  ARM: SAMSUNG: Use spin_lock_{irqsave,irqrestore} in clk_set_rate
  ARM: SAMSUNG: use spin_lock_irqsave() in clk_set_parent
  • Loading branch information
Olof Johansson committed Sep 18, 2012
2 parents 5698bd7 + d6838a6 commit d7235b8
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions arch/arm/plat-samsung/clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ long clk_round_rate(struct clk *clk, unsigned long rate)

int clk_set_rate(struct clk *clk, unsigned long rate)
{
unsigned long flags;
int ret;

if (IS_ERR(clk))
Expand All @@ -159,9 +160,9 @@ int clk_set_rate(struct clk *clk, unsigned long rate)
if (clk->ops == NULL || clk->ops->set_rate == NULL)
return -EINVAL;

spin_lock(&clocks_lock);
spin_lock_irqsave(&clocks_lock, flags);
ret = (clk->ops->set_rate)(clk, rate);
spin_unlock(&clocks_lock);
spin_unlock_irqrestore(&clocks_lock, flags);

return ret;
}
Expand All @@ -173,17 +174,18 @@ struct clk *clk_get_parent(struct clk *clk)

int clk_set_parent(struct clk *clk, struct clk *parent)
{
unsigned long flags;
int ret = 0;

if (IS_ERR(clk))
return -EINVAL;

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

if (clk->ops && clk->ops->set_parent)
ret = (clk->ops->set_parent)(clk, parent);

spin_unlock(&clocks_lock);
spin_unlock_irqrestore(&clocks_lock, flags);

return ret;
}
Expand Down

0 comments on commit d7235b8

Please sign in to comment.