diff options
author | Arjan van de Ven <arjan@infradead.org> | 2006-01-12 13:42:23 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2006-01-12 13:42:23 -0500 |
commit | 00431707be0cc1236ee08459367872b57da5be29 (patch) | |
tree | 0a57cbf54f1fcc9ef2852e68e96c3b99e1b903d8 /arch/arm/plat-omap/clock.c | |
parent | f4619025a51747a3788fd1bb6bdc46e368a889a7 (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.c | 15 |
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 | ||
29 | LIST_HEAD(clocks); | 30 | LIST_HEAD(clocks); |
30 | static DECLARE_MUTEX(clocks_sem); | 31 | static DEFINE_MUTEX(clocks_mutex); |
31 | DEFINE_SPINLOCK(clockfw_lock); | 32 | DEFINE_SPINLOCK(clockfw_lock); |
32 | 33 | ||
33 | static struct clk_functions *arch_clock; | 34 | static 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 | ||
250 | int clk_register(struct clk *clk) | 251 | int 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 | ||
262 | void clk_unregister(struct clk *clk) | 263 | void 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 | } |
268 | EXPORT_SYMBOL(clk_unregister); | 269 | EXPORT_SYMBOL(clk_unregister); |
269 | 270 | ||