aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-integrator/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/mach-integrator/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/mach-integrator/clock.c')
-rw-r--r--arch/arm/mach-integrator/clock.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/arch/arm/mach-integrator/clock.c b/arch/arm/mach-integrator/clock.c
index 40684e01e865..95a1e263f7fa 100644
--- a/arch/arm/mach-integrator/clock.c
+++ b/arch/arm/mach-integrator/clock.c
@@ -15,6 +15,7 @@
15#include <linux/err.h> 15#include <linux/err.h>
16#include <linux/string.h> 16#include <linux/string.h>
17#include <linux/clk.h> 17#include <linux/clk.h>
18#include <linux/mutex.h>
18 19
19#include <asm/semaphore.h> 20#include <asm/semaphore.h>
20#include <asm/hardware/icst525.h> 21#include <asm/hardware/icst525.h>
@@ -22,20 +23,20 @@
22#include "clock.h" 23#include "clock.h"
23 24
24static LIST_HEAD(clocks); 25static LIST_HEAD(clocks);
25static DECLARE_MUTEX(clocks_sem); 26static DEFINE_MUTEX(clocks_mutex);
26 27
27struct clk *clk_get(struct device *dev, const char *id) 28struct 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}
@@ -107,18 +108,18 @@ static struct clk uart_clk = {
107 108
108int clk_register(struct clk *clk) 109int clk_register(struct clk *clk)
109{ 110{
110 down(&clocks_sem); 111 mutex_lock(&clocks_mutex);
111 list_add(&clk->node, &clocks); 112 list_add(&clk->node, &clocks);
112 up(&clocks_sem); 113 mutex_unlock(&clocks_mutex);
113 return 0; 114 return 0;
114} 115}
115EXPORT_SYMBOL(clk_register); 116EXPORT_SYMBOL(clk_register);
116 117
117void clk_unregister(struct clk *clk) 118void clk_unregister(struct clk *clk)
118{ 119{
119 down(&clocks_sem); 120 mutex_lock(&clocks_mutex);
120 list_del(&clk->node); 121 list_del(&clk->node);
121 up(&clocks_sem); 122 mutex_unlock(&clocks_mutex);
122} 123}
123EXPORT_SYMBOL(clk_unregister); 124EXPORT_SYMBOL(clk_unregister);
124 125