summaryrefslogtreecommitdiffstats
path: root/arch/arm/plat-samsung/clock.c
diff options
context:
space:
mode:
authorMinho Ban <mhban@samsung.com>2012-01-20 11:03:07 +0900
committerKukjin Kim <kgene.kim@samsung.com>2012-02-12 01:03:02 +0900
commit0cdf3affd3ddf4ff1a88e32b89bc629d569793f3 (patch)
tree1d67f49bb9fbb3fb7edcb3ed6f539dd0e5ddcefc /arch/arm/plat-samsung/clock.c
parent8942ad89a059f9854ddf7223ca6e32869d7d9059 (diff)
ARM: SAMSUNG: use spin_lock_irqsave() in clk_{enable,disable}
The clk_enable()and clk_disable() can be used process and ISR either. And actually it is used for real product and other platforms use it now. So spin_lock_irqsave() should be used instead. Signed-off-by: Minho Ban <mhban@samsung.com> Signed-off-by: Jaecheol Lee <jc.lee@samsung.com> Signed-off-by: Sunyoung Kang <sy0816.kang@samsung.com> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
Diffstat (limited to 'arch/arm/plat-samsung/clock.c')
-rw-r--r--arch/arm/plat-samsung/clock.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/arch/arm/plat-samsung/clock.c b/arch/arm/plat-samsung/clock.c
index 10f71179071..65c5eca475e 100644
--- a/arch/arm/plat-samsung/clock.c
+++ b/arch/arm/plat-samsung/clock.c
@@ -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);
}