summaryrefslogtreecommitdiffstats
path: root/arch/arm/common/rtctime.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2006-01-12 12:23:49 -0800
committerLinus Torvalds <torvalds@g5.osdl.org>2006-01-12 12:23:49 -0800
commitbf785ee0aeea7a3e717cb1e11df4135b6cbde7da (patch)
tree32ae52ad51c2a3952f2e1a2af9217717954fa593 /arch/arm/common/rtctime.c
parent8b87e1baff24e586c3fe6c168843d213119bf4dd (diff)
parent00431707be0cc1236ee08459367872b57da5be29 (diff)
downloadblackbird-op-linux-bf785ee0aeea7a3e717cb1e11df4135b6cbde7da.tar.gz
blackbird-op-linux-bf785ee0aeea7a3e717cb1e11df4135b6cbde7da.zip
Merge master.kernel.org:/home/rmk/linux-2.6-arm
Diffstat (limited to 'arch/arm/common/rtctime.c')
-rw-r--r--arch/arm/common/rtctime.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/arch/arm/common/rtctime.c b/arch/arm/common/rtctime.c
index ffb82d5bedef..48b1e19b131f 100644
--- a/arch/arm/common/rtctime.c
+++ b/arch/arm/common/rtctime.c
@@ -19,6 +19,7 @@
#include <linux/spinlock.h>
#include <linux/capability.h>
#include <linux/device.h>
+#include <linux/mutex.h>
#include <asm/rtc.h>
#include <asm/semaphore.h>
@@ -35,7 +36,7 @@ static unsigned long rtc_irq_data;
/*
* rtc_sem protects rtc_inuse and rtc_ops
*/
-static DECLARE_MUTEX(rtc_sem);
+static DEFINE_MUTEX(rtc_mutex);
static unsigned long rtc_inuse;
static struct rtc_ops *rtc_ops;
@@ -356,7 +357,7 @@ static int rtc_open(struct inode *inode, struct file *file)
{
int ret;
- down(&rtc_sem);
+ mutex_lock(&rtc_mutex);
if (rtc_inuse) {
ret = -EBUSY;
@@ -374,7 +375,7 @@ static int rtc_open(struct inode *inode, struct file *file)
rtc_inuse = 1;
}
}
- up(&rtc_sem);
+ mutex_unlock(&rtc_mutex);
return ret;
}
@@ -480,7 +481,7 @@ int register_rtc(struct rtc_ops *ops)
{
int ret = -EBUSY;
- down(&rtc_sem);
+ mutex_lock(&rtc_mutex);
if (rtc_ops == NULL) {
rtc_ops = ops;
@@ -489,7 +490,7 @@ int register_rtc(struct rtc_ops *ops)
create_proc_read_entry("driver/rtc", 0, NULL,
rtc_read_proc, ops);
}
- up(&rtc_sem);
+ mutex_unlock(&rtc_mutex);
return ret;
}
@@ -497,12 +498,12 @@ EXPORT_SYMBOL(register_rtc);
void unregister_rtc(struct rtc_ops *rtc)
{
- down(&rtc_sem);
+ mutex_lock(&rtc_mutex);
if (rtc == rtc_ops) {
remove_proc_entry("driver/rtc", NULL);
misc_deregister(&rtc_miscdev);
rtc_ops = NULL;
}
- up(&rtc_sem);
+ mutex_unlock(&rtc_mutex);
}
EXPORT_SYMBOL(unregister_rtc);
OpenPOWER on IntegriCloud