aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/plat-omap/clock.c
diff options
context:
space:
mode:
authorArjan van de Ven <arjan@infradead.org>2006-01-12 13:42:23 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2006-01-12 13:42:23 -0500
commit00431707be0cc1236ee08459367872b57da5be29 (patch)
tree0a57cbf54f1fcc9ef2852e68e96c3b99e1b903d8 /arch/arm/plat-omap/clock.c
parentf4619025a51747a3788fd1bb6bdc46e368a889a7 (diff)
[ARM] Convert some arm semaphores to mutexes
The arm clock semaphores are strict mutexes, convert them to the new mutex implementation Signed-off-by: Arjan van de Ven <arjan@infradead.org> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/plat-omap/clock.c')
-rw-r--r--arch/arm/plat-omap/clock.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/arch/arm/plat-omap/clock.c b/arch/arm/plat-omap/clock.c
index 84fd65656fcf..7ebc5a29db8d 100644
--- a/arch/arm/plat-omap/clock.c
+++ b/arch/arm/plat-omap/clock.c
@@ -20,6 +20,7 @@
20#include <linux/err.h> 20#include <linux/err.h>
21#include <linux/string.h> 21#include <linux/string.h>
22#include <linux/clk.h> 22#include <linux/clk.h>
23#include <linux/mutex.h>
23 24
24#include <asm/io.h> 25#include <asm/io.h>
25#include <asm/semaphore.h> 26#include <asm/semaphore.h>
@@ -27,7 +28,7 @@
27#include <asm/arch/clock.h> 28#include <asm/arch/clock.h>
28 29
29LIST_HEAD(clocks); 30LIST_HEAD(clocks);
30static DECLARE_MUTEX(clocks_sem); 31static DEFINE_MUTEX(clocks_mutex);
31DEFINE_SPINLOCK(clockfw_lock); 32DEFINE_SPINLOCK(clockfw_lock);
32 33
33static struct clk_functions *arch_clock; 34static struct clk_functions *arch_clock;
@@ -40,14 +41,14 @@ struct clk * clk_get(struct device *dev, const char *id)
40{ 41{
41 struct clk *p, *clk = ERR_PTR(-ENOENT); 42 struct clk *p, *clk = ERR_PTR(-ENOENT);
42 43
43 down(&clocks_sem); 44 mutex_lock(&clocks_mutex);
44 list_for_each_entry(p, &clocks, node) { 45 list_for_each_entry(p, &clocks, node) {
45 if (strcmp(id, p->name) == 0 && try_module_get(p->owner)) { 46 if (strcmp(id, p->name) == 0 && try_module_get(p->owner)) {
46 clk = p; 47 clk = p;
47 break; 48 break;
48 } 49 }
49 } 50 }
50 up(&clocks_sem); 51 mutex_unlock(&clocks_mutex);
51 52
52 return clk; 53 return clk;
53} 54}
@@ -249,11 +250,11 @@ void propagate_rate(struct clk * tclk)
249 250
250int clk_register(struct clk *clk) 251int clk_register(struct clk *clk)
251{ 252{
252 down(&clocks_sem); 253 mutex_lock(&clocks_mutex);
253 list_add(&clk->node, &clocks); 254 list_add(&clk->node, &clocks);
254 if (clk->init) 255 if (clk->init)
255 clk->init(clk); 256 clk->init(clk);
256 up(&clocks_sem); 257 mutex_unlock(&clocks_mutex);
257 258
258 return 0; 259 return 0;
259} 260}
@@ -261,9 +262,9 @@ EXPORT_SYMBOL(clk_register);
261 262
262void clk_unregister(struct clk *clk) 263void clk_unregister(struct clk *clk)
263{ 264{
264 down(&clocks_sem); 265 mutex_lock(&clocks_mutex);
265 list_del(&clk->node); 266 list_del(&clk->node);
266 up(&clocks_sem); 267 mutex_unlock(&clocks_mutex);
267} 268}
268EXPORT_SYMBOL(clk_unregister); 269EXPORT_SYMBOL(clk_unregister);
269 270