aboutsummaryrefslogtreecommitdiffstats
path: root/arch/cris/arch-v10/drivers/ds1302.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/cris/arch-v10/drivers/ds1302.c')
-rw-r--r--arch/cris/arch-v10/drivers/ds1302.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/arch/cris/arch-v10/drivers/ds1302.c b/arch/cris/arch-v10/drivers/ds1302.c
index 884275629ef7..3d655dcc65da 100644
--- a/arch/cris/arch-v10/drivers/ds1302.c
+++ b/arch/cris/arch-v10/drivers/ds1302.c
@@ -19,7 +19,7 @@
19#include <linux/module.h> 19#include <linux/module.h>
20#include <linux/miscdevice.h> 20#include <linux/miscdevice.h>
21#include <linux/delay.h> 21#include <linux/delay.h>
22#include <linux/smp_lock.h> 22#include <linux/mutex.h>
23#include <linux/bcd.h> 23#include <linux/bcd.h>
24#include <linux/capability.h> 24#include <linux/capability.h>
25 25
@@ -34,6 +34,7 @@
34 34
35#define RTC_MAJOR_NR 121 /* local major, change later */ 35#define RTC_MAJOR_NR 121 /* local major, change later */
36 36
37static DEFINE_MUTEX(ds1302_mutex);
37static const char ds1302_name[] = "ds1302"; 38static const char ds1302_name[] = "ds1302";
38 39
39/* The DS1302 might be connected to different bits on different products. 40/* The DS1302 might be connected to different bits on different products.
@@ -357,9 +358,9 @@ static long rtc_unlocked_ioctl(struct file *file, unsigned int cmd, unsigned lon
357{ 358{
358 int ret; 359 int ret;
359 360
360 lock_kernel(); 361 mutex_lock(&ds1302_mutex);
361 ret = rtc_ioctl(file, cmd, arg); 362 ret = rtc_ioctl(file, cmd, arg);
362 unlock_kernel(); 363 mutex_unlock(&ds1302_mutex);
363 364
364 return ret; 365 return ret;
365} 366}
@@ -387,6 +388,7 @@ print_rtc_status(void)
387static const struct file_operations rtc_fops = { 388static const struct file_operations rtc_fops = {
388 .owner = THIS_MODULE, 389 .owner = THIS_MODULE,
389 .unlocked_ioctl = rtc_unlocked_ioctl, 390 .unlocked_ioctl = rtc_unlocked_ioctl,
391 .llseek = noop_llseek,
390}; 392};
391 393
392/* Probe for the chip by writing something to its RAM and try reading it back. */ 394/* Probe for the chip by writing something to its RAM and try reading it back. */