Commit 0cdf3aff authored by Minho Ban's avatar Minho Ban Committed by Kukjin Kim

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: default avatarMinho Ban <mhban@samsung.com>
Signed-off-by: default avatarJaecheol Lee <jc.lee@samsung.com>
Signed-off-by: default avatarSunyoung Kang <sy0816.kang@samsung.com>
Signed-off-by: default avatarKukjin Kim <kgene.kim@samsung.com>
parent 8942ad89
...@@ -84,31 +84,35 @@ static int clk_null_enable(struct clk *clk, int enable) ...@@ -84,31 +84,35 @@ static int clk_null_enable(struct clk *clk, int enable)
int clk_enable(struct clk *clk) int clk_enable(struct clk *clk)
{ {
unsigned long flags;
if (IS_ERR(clk) || clk == NULL) if (IS_ERR(clk) || clk == NULL)
return -EINVAL; return -EINVAL;
clk_enable(clk->parent); clk_enable(clk->parent);
spin_lock(&clocks_lock); spin_lock_irqsave(&clocks_lock, flags);
if ((clk->usage++) == 0) if ((clk->usage++) == 0)
(clk->enable)(clk, 1); (clk->enable)(clk, 1);
spin_unlock(&clocks_lock); spin_unlock_irqrestore(&clocks_lock, flags);
return 0; return 0;
} }
void clk_disable(struct clk *clk) void clk_disable(struct clk *clk)
{ {
unsigned long flags;
if (IS_ERR(clk) || clk == NULL) if (IS_ERR(clk) || clk == NULL)
return; return;
spin_lock(&clocks_lock); spin_lock_irqsave(&clocks_lock, flags);
if ((--clk->usage) == 0) if ((--clk->usage) == 0)
(clk->enable)(clk, 0); (clk->enable)(clk, 0);
spin_unlock(&clocks_lock); spin_unlock_irqrestore(&clocks_lock, flags);
clk_disable(clk->parent); clk_disable(clk->parent);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment