aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-pxa/clock.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-12 17:17:12 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-12 17:17:12 -0400
commit4aabab2181f20560948c2045ce1faaa9ac1507a8 (patch)
tree6556e126687c9cbb4b4a35a8ad8c327df30ac256 /arch/arm/mach-pxa/clock.c
parentbb50cbbd4beacd5ceda76c32fcb116c67fe8c66c (diff)
parentca9ced7f6798868f9d2c81a59b49f8c2136685d8 (diff)
Merge branch 'devel' of master.kernel.org:/home/rmk/linux-2.6-arm
* 'devel' of master.kernel.org:/home/rmk/linux-2.6-arm: (50 commits) [ARM] sa1100: remove boot time RTC initialisation [ARM] sa1100: stop doing our own rtc management over suspend [ARM] 4474/1: Do not check the PSR_F_BIT in valid_user_regs [ARM] 4473/2: Take the HWCAP definitions out of the elf.h file [ARM] pxa: move platform devices to separate header file [ARM] pxa: move device registration into CPU-specific file [ARM] pxa: remove boot time RTC initialisation [ARM] pxa: stop doing our own rtc management over suspend [ARM] 4451/1: pxa: make dma.c generic and remove cpu specific dma code [ARM] 4450/1: pxa: add pxa25x_init_irq() and pxa27x_init_irq() [ARM] 4440/1: PXA: enable the checking of ICIP2 for IRQs [ARM] 4438/1: PXA: remove #ifdef .. #endif from pxa_gpio_demux_handler() [ARM] 4437/1: PXA: move the GPIO IRQ initialization code to pxa_init_irq_gpio() [ARM] 4436/1: PXA: move low IRQ initialization code to pxa_init_irq_low() [ARM] 4435/1: PXA: remove PXA_INTERNAL_IRQS [ARM] 4434/1: PXA: remove PXA_IRQ_SKIP [ARM] pxa: Fix PXA27x suspend type validation, remove pxa_pm_prepare() [ARM] pxa: move pm_ops structure into CPU specific files [ARM] pxa: introduce cpu_is_pxaXXX macros [ARM] pxa: remove MMC register defines from pxa-regs.h ...
Diffstat (limited to 'arch/arm/mach-pxa/clock.c')
-rw-r--r--arch/arm/mach-pxa/clock.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/arch/arm/mach-pxa/clock.c b/arch/arm/mach-pxa/clock.c
index 8f7c90a0593b..34a31caa6f9d 100644
--- a/arch/arm/mach-pxa/clock.c
+++ b/arch/arm/mach-pxa/clock.c
@@ -12,7 +12,6 @@
12 12
13#include <asm/arch/pxa-regs.h> 13#include <asm/arch/pxa-regs.h>
14#include <asm/hardware.h> 14#include <asm/hardware.h>
15#include <asm/semaphore.h>
16 15
17struct clk { 16struct clk {
18 struct list_head node; 17 struct list_head node;
@@ -25,21 +24,21 @@ struct clk {
25}; 24};
26 25
27static LIST_HEAD(clocks); 26static LIST_HEAD(clocks);
28static DECLARE_MUTEX(clocks_sem); 27static DEFINE_MUTEX(clocks_mutex);
29static DEFINE_SPINLOCK(clocks_lock); 28static DEFINE_SPINLOCK(clocks_lock);
30 29
31struct clk *clk_get(struct device *dev, const char *id) 30struct clk *clk_get(struct device *dev, const char *id)
32{ 31{
33 struct clk *p, *clk = ERR_PTR(-ENOENT); 32 struct clk *p, *clk = ERR_PTR(-ENOENT);
34 33
35 down(&clocks_sem); 34 mutex_lock(&clocks_mutex);
36 list_for_each_entry(p, &clocks, node) { 35 list_for_each_entry(p, &clocks, node) {
37 if (strcmp(id, p->name) == 0 && try_module_get(p->owner)) { 36 if (strcmp(id, p->name) == 0 && try_module_get(p->owner)) {
38 clk = p; 37 clk = p;
39 break; 38 break;
40 } 39 }
41 } 40 }
42 up(&clocks_sem); 41 mutex_unlock(&clocks_mutex);
43 42
44 return clk; 43 return clk;
45} 44}
@@ -101,18 +100,18 @@ static struct clk clk_gpio27 = {
101 100
102int clk_register(struct clk *clk) 101int clk_register(struct clk *clk)
103{ 102{
104 down(&clocks_sem); 103 mutex_lock(&clocks_mutex);
105 list_add(&clk->node, &clocks); 104 list_add(&clk->node, &clocks);
106 up(&clocks_sem); 105 mutex_unlock(&clocks_mutex);
107 return 0; 106 return 0;
108} 107}
109EXPORT_SYMBOL(clk_register); 108EXPORT_SYMBOL(clk_register);
110 109
111void clk_unregister(struct clk *clk) 110void clk_unregister(struct clk *clk)
112{ 111{
113 down(&clocks_sem); 112 mutex_lock(&clocks_mutex);
114 list_del(&clk->node); 113 list_del(&clk->node);
115 up(&clocks_sem); 114 mutex_unlock(&clocks_mutex);
116} 115}
117EXPORT_SYMBOL(clk_unregister); 116EXPORT_SYMBOL(clk_unregister);
118 117