diff options
Diffstat (limited to 'drivers/char/mmtimer.c')
| -rw-r--r-- | drivers/char/mmtimer.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/char/mmtimer.c b/drivers/char/mmtimer.c index ea7c99fa978f..fe4697844ec1 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 | ||
| 62 | static DEFINE_MUTEX(mmtimer_mutex); | ||
| 62 | static long mmtimer_ioctl(struct file *file, unsigned int cmd, | 63 | static long mmtimer_ioctl(struct file *file, unsigned int cmd, |
| 63 | unsigned long arg); | 64 | unsigned long arg); |
| 64 | static int mmtimer_mmap(struct file *file, struct vm_area_struct *vma); | 65 | static int mmtimer_mmap(struct file *file, struct vm_area_struct *vma); |
| @@ -371,7 +372,7 @@ static long mmtimer_ioctl(struct file *file, unsigned int cmd, | |||
| 371 | { | 372 | { |
| 372 | int ret = 0; | 373 | int ret = 0; |
| 373 | 374 | ||
| 374 | lock_kernel(); | 375 | mutex_lock(&mmtimer_mutex); |
| 375 | 376 | ||
| 376 | switch (cmd) { | 377 | switch (cmd) { |
| 377 | case MMTIMER_GETOFFSET: /* offset of the counter */ | 378 | case MMTIMER_GETOFFSET: /* offset of the counter */ |
| @@ -414,7 +415,7 @@ static long mmtimer_ioctl(struct file *file, unsigned int cmd, | |||
| 414 | ret = -ENOTTY; | 415 | ret = -ENOTTY; |
| 415 | break; | 416 | break; |
| 416 | } | 417 | } |
| 417 | unlock_kernel(); | 418 | mutex_unlock(&mmtimer_mutex); |
| 418 | return ret; | 419 | return ret; |
| 419 | } | 420 | } |
| 420 | 421 | ||
