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/mach-aaec2000 | |
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/mach-aaec2000')
-rw-r--r-- | arch/arm/mach-aaec2000/clock.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/arch/arm/mach-aaec2000/clock.c b/arch/arm/mach-aaec2000/clock.c index 1c84c60941e1..74aa7a39bb68 100644 --- a/arch/arm/mach-aaec2000/clock.c +++ b/arch/arm/mach-aaec2000/clock.c | |||
@@ -16,26 +16,27 @@ | |||
16 | #include <linux/err.h> | 16 | #include <linux/err.h> |
17 | #include <linux/string.h> | 17 | #include <linux/string.h> |
18 | #include <linux/clk.h> | 18 | #include <linux/clk.h> |
19 | #include <linux/mutex.h> | ||
19 | 20 | ||
20 | #include <asm/semaphore.h> | 21 | #include <asm/semaphore.h> |
21 | 22 | ||
22 | #include "clock.h" | 23 | #include "clock.h" |
23 | 24 | ||
24 | static LIST_HEAD(clocks); | 25 | static LIST_HEAD(clocks); |
25 | static DECLARE_MUTEX(clocks_sem); | 26 | static DEFINE_MUTEX(clocks_mutex); |
26 | 27 | ||
27 | struct clk *clk_get(struct device *dev, const char *id) | 28 | struct clk *clk_get(struct device *dev, const char *id) |
28 | { | 29 | { |
29 | struct clk *p, *clk = ERR_PTR(-ENOENT); | 30 | struct clk *p, *clk = ERR_PTR(-ENOENT); |
30 | 31 | ||
31 | down(&clocks_sem); | 32 | mutex_lock(&clocks_mutex); |
32 | list_for_each_entry(p, &clocks, node) { | 33 | list_for_each_entry(p, &clocks, node) { |
33 | if (strcmp(id, p->name) == 0 && try_module_get(p->owner)) { | 34 | if (strcmp(id, p->name) == 0 && try_module_get(p->owner)) { |
34 | clk = p; | 35 | clk = p; |
35 | break; | 36 | break; |
36 | } | 37 | } |
37 | } | 38 | } |
38 | up(&clocks_sem); | 39 | mutex_unlock(&clocks_mutex); |
39 | 40 | ||
40 | return clk; | 41 | return clk; |
41 | } | 42 | } |
@@ -78,18 +79,18 @@ EXPORT_SYMBOL(clk_set_rate); | |||
78 | 79 | ||
79 | int clk_register(struct clk *clk) | 80 | int clk_register(struct clk *clk) |
80 | { | 81 | { |
81 | down(&clocks_sem); | 82 | mutex_lock(&clocks_mutex); |
82 | list_add(&clk->node, &clocks); | 83 | list_add(&clk->node, &clocks); |
83 | up(&clocks_sem); | 84 | mutex_unlock(&clocks_mutex); |
84 | return 0; | 85 | return 0; |
85 | } | 86 | } |
86 | EXPORT_SYMBOL(clk_register); | 87 | EXPORT_SYMBOL(clk_register); |
87 | 88 | ||
88 | void clk_unregister(struct clk *clk) | 89 | void clk_unregister(struct clk *clk) |
89 | { | 90 | { |
90 | down(&clocks_sem); | 91 | mutex_lock(&clocks_mutex); |
91 | list_del(&clk->node); | 92 | list_del(&clk->node); |
92 | up(&clocks_sem); | 93 | mutex_unlock(&clocks_mutex); |
93 | } | 94 | } |
94 | EXPORT_SYMBOL(clk_unregister); | 95 | EXPORT_SYMBOL(clk_unregister); |
95 | 96 | ||