diff options
author | Arjan van de Ven <arjan@infradead.org> | 2006-01-12 18:42:23 +0000 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2006-01-12 18:42:23 +0000 |
commit | 00431707be0cc1236ee08459367872b57da5be29 (patch) | |
tree | 0a57cbf54f1fcc9ef2852e68e96c3b99e1b903d8 /arch/arm/mach-versatile/clock.c | |
parent | f4619025a51747a3788fd1bb6bdc46e368a889a7 (diff) | |
download | kernel-crypto-00431707be0cc1236ee08459367872b57da5be29.tar.gz kernel-crypto-00431707be0cc1236ee08459367872b57da5be29.tar.xz kernel-crypto-00431707be0cc1236ee08459367872b57da5be29.zip |
[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-versatile/clock.c')
-rw-r--r-- | arch/arm/mach-versatile/clock.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/arch/arm/mach-versatile/clock.c b/arch/arm/mach-versatile/clock.c index dcf10014f5c..9858c96560e 100644 --- a/arch/arm/mach-versatile/clock.c +++ b/arch/arm/mach-versatile/clock.c @@ -15,6 +15,7 @@ #include <linux/err.h> #include <linux/string.h> #include <linux/clk.h> +#include <linux/mutex.h> #include <asm/semaphore.h> #include <asm/hardware/icst307.h> @@ -22,20 +23,20 @@ #include "clock.h" static LIST_HEAD(clocks); -static DECLARE_MUTEX(clocks_sem); +static DEFINE_MUTEX(clocks_mutex); struct clk *clk_get(struct device *dev, const char *id) { struct clk *p, *clk = ERR_PTR(-ENOENT); - down(&clocks_sem); + mutex_lock(&clocks_mutex); list_for_each_entry(p, &clocks, node) { if (strcmp(id, p->name) == 0 && try_module_get(p->owner)) { clk = p; break; } } - up(&clocks_sem); + mutex_unlock(&clocks_mutex); return clk; } @@ -110,18 +111,18 @@ static struct clk mmci_clk = { int clk_register(struct clk *clk) { - down(&clocks_sem); + mutex_lock(&clocks_mutex); list_add(&clk->node, &clocks); - up(&clocks_sem); + mutex_unlock(&clocks_mutex); return 0; } EXPORT_SYMBOL(clk_register); void clk_unregister(struct clk *clk) { - down(&clocks_sem); + mutex_lock(&clocks_mutex); list_del(&clk->node); - up(&clocks_sem); + mutex_unlock(&clocks_mutex); } EXPORT_SYMBOL(clk_unregister); |