aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/mmtimer.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/char/mmtimer.c')
-rw-r--r--drivers/char/mmtimer.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/char/mmtimer.c b/drivers/char/mmtimer.c
index 1c4070ced066..c070b53984e4 100644
--- a/drivers/char/mmtimer.c
+++ b/drivers/char/mmtimer.c
@@ -32,7 +32,7 @@
32#include <linux/interrupt.h> 32#include <linux/interrupt.h>
33#include <linux/time.h> 33#include <linux/time.h>
34#include <linux/math64.h> 34#include <linux/math64.h>
35#include <linux/smp_lock.h> 35#include <linux/mutex.h>
36#include <linux/slab.h> 36#include <linux/slab.h>
37 37
38#include <asm/uaccess.h> 38#include <asm/uaccess.h>
@@ -59,6 +59,7 @@ extern unsigned long sn_rtc_cycles_per_second;
59 59
60#define rtc_time() (*RTC_COUNTER_ADDR) 60#define rtc_time() (*RTC_COUNTER_ADDR)
61 61
62static DEFINE_MUTEX(mmtimer_mutex);
62static long mmtimer_ioctl(struct file *file, unsigned int cmd, 63static long mmtimer_ioctl(struct file *file, unsigned int cmd,
63 unsigned long arg); 64 unsigned long arg);
64static int mmtimer_mmap(struct file *file, struct vm_area_struct *vma); 65static int mmtimer_mmap(struct file *file, struct vm_area_struct *vma);
@@ -372,7 +373,7 @@ static long mmtimer_ioctl(struct file *file, unsigned int cmd,
372{ 373{
373 int ret = 0; 374 int ret = 0;
374 375
375 lock_kernel(); 376 mutex_lock(&mmtimer_mutex);
376 377
377 switch (cmd) { 378 switch (cmd) {
378 case MMTIMER_GETOFFSET: /* offset of the counter */ 379 case MMTIMER_GETOFFSET: /* offset of the counter */
@@ -415,7 +416,7 @@ static long mmtimer_ioctl(struct file *file, unsigned int cmd,
415 ret = -ENOTTY; 416 ret = -ENOTTY;
416 break; 417 break;
417 } 418 }
418 unlock_kernel(); 419 mutex_unlock(&mmtimer_mutex);
419 return ret; 420 return ret;
420} 421}
421 422