diff options
author | Minho Ban <mhban@samsung.com> | 2012-01-19 21:03:07 -0500 |
---|---|---|
committer | Kukjin Kim <kgene.kim@samsung.com> | 2012-02-11 11:03:02 -0500 |
commit | 0cdf3affd3ddf4ff1a88e32b89bc629d569793f3 (patch) | |
tree | 1d67f49bb9fbb3fb7edcb3ed6f539dd0e5ddcefc /arch | |
parent | 8942ad89a059f9854ddf7223ca6e32869d7d9059 (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')
-rw-r--r-- | arch/arm/plat-samsung/clock.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/arch/arm/plat-samsung/clock.c b/arch/arm/plat-samsung/clock.c index 10f71179071f..65c5eca475e7 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) | |||
84 | 84 | ||
85 | int clk_enable(struct clk *clk) | 85 | int clk_enable(struct clk *clk) |
86 | { | 86 | { |
87 | unsigned long flags; | ||
88 | |||
87 | if (IS_ERR(clk) || clk == NULL) | 89 | if (IS_ERR(clk) || clk == NULL) |
88 | return -EINVAL; | 90 | return -EINVAL; |
89 | 91 | ||
90 | clk_enable(clk->parent); | 92 | clk_enable(clk->parent); |
91 | 93 | ||
92 | spin_lock(&clocks_lock); | 94 | spin_lock_irqsave(&clocks_lock, flags); |
93 | 95 | ||
94 | if ((clk->usage++) == 0) | 96 | if ((clk->usage++) == 0) |
95 | (clk->enable)(clk, 1); | 97 | (clk->enable)(clk, 1); |
96 | 98 | ||
97 | spin_unlock(&clocks_lock); | 99 | spin_unlock_irqrestore(&clocks_lock, flags); |
98 | return 0; | 100 | return 0; |
99 | } | 101 | } |
100 | 102 | ||
101 | void clk_disable(struct clk *clk) | 103 | void clk_disable(struct clk *clk) |
102 | { | 104 | { |
105 | unsigned long flags; | ||
106 | |||
103 | if (IS_ERR(clk) || clk == NULL) | 107 | if (IS_ERR(clk) || clk == NULL) |
104 | return; | 108 | return; |
105 | 109 | ||
106 | spin_lock(&clocks_lock); | 110 | spin_lock_irqsave(&clocks_lock, flags); |
107 | 111 | ||
108 | if ((--clk->usage) == 0) | 112 | if ((--clk->usage) == 0) |
109 | (clk->enable)(clk, 0); | 113 | (clk->enable)(clk, 0); |
110 | 114 | ||
111 | spin_unlock(&clocks_lock); | 115 | spin_unlock_irqrestore(&clocks_lock, flags); |
112 | clk_disable(clk->parent); | 116 | clk_disable(clk->parent); |
113 | } | 117 | } |
114 | 118 | ||