aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-aaec2000/clock.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-aaec2000/clock.c')
-rw-r--r--arch/arm/mach-aaec2000/clock.c15
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
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}
@@ -78,18 +79,18 @@ EXPORT_SYMBOL(clk_set_rate);
78 79
79int clk_register(struct clk *clk) 80int 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}
86EXPORT_SYMBOL(clk_register); 87EXPORT_SYMBOL(clk_register);
87 88
88void clk_unregister(struct clk *clk) 89void 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}
94EXPORT_SYMBOL(clk_unregister); 95EXPORT_SYMBOL(clk_unregister);
95 96