aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/misc/hp_sdc_rtc.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/input/misc/hp_sdc_rtc.c')
-rw-r--r--drivers/input/misc/hp_sdc_rtc.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/input/misc/hp_sdc_rtc.c b/drivers/input/misc/hp_sdc_rtc.c
index c19066479057..0b4f54265f62 100644
--- a/drivers/input/misc/hp_sdc_rtc.c
+++ b/drivers/input/misc/hp_sdc_rtc.c
@@ -43,7 +43,7 @@
43#include <linux/proc_fs.h> 43#include <linux/proc_fs.h>
44#include <linux/poll.h> 44#include <linux/poll.h>
45#include <linux/rtc.h> 45#include <linux/rtc.h>
46#include <linux/smp_lock.h> 46#include <linux/mutex.h>
47#include <linux/semaphore.h> 47#include <linux/semaphore.h>
48 48
49MODULE_AUTHOR("Brian S. Julin <bri@calyx.com>"); 49MODULE_AUTHOR("Brian S. Julin <bri@calyx.com>");
@@ -52,6 +52,7 @@ MODULE_LICENSE("Dual BSD/GPL");
52 52
53#define RTC_VERSION "1.10d" 53#define RTC_VERSION "1.10d"
54 54
55static DEFINE_MUTEX(hp_sdc_rtc_mutex);
55static unsigned long epoch = 2000; 56static unsigned long epoch = 2000;
56 57
57static struct semaphore i8042tregs; 58static struct semaphore i8042tregs;
@@ -104,7 +105,7 @@ static int hp_sdc_rtc_do_read_bbrtc (struct rtc_time *rtctm)
104 t.endidx = 91; 105 t.endidx = 91;
105 t.seq = tseq; 106 t.seq = tseq;
106 t.act.semaphore = &tsem; 107 t.act.semaphore = &tsem;
107 init_MUTEX_LOCKED(&tsem); 108 sema_init(&tsem, 0);
108 109
109 if (hp_sdc_enqueue_transaction(&t)) return -1; 110 if (hp_sdc_enqueue_transaction(&t)) return -1;
110 111
@@ -665,9 +666,9 @@ static long hp_sdc_rtc_unlocked_ioctl(struct file *file,
665{ 666{
666 int ret; 667 int ret;
667 668
668 lock_kernel(); 669 mutex_lock(&hp_sdc_rtc_mutex);
669 ret = hp_sdc_rtc_ioctl(file, cmd, arg); 670 ret = hp_sdc_rtc_ioctl(file, cmd, arg);
670 unlock_kernel(); 671 mutex_unlock(&hp_sdc_rtc_mutex);
671 672
672 return ret; 673 return ret;
673} 674}
@@ -698,7 +699,7 @@ static int __init hp_sdc_rtc_init(void)
698 return -ENODEV; 699 return -ENODEV;
699#endif 700#endif
700 701
701 init_MUTEX(&i8042tregs); 702 sema_init(&i8042tregs, 1);
702 703
703 if ((ret = hp_sdc_request_timer_irq(&hp_sdc_rtc_isr))) 704 if ((ret = hp_sdc_request_timer_irq(&hp_sdc_rtc_isr)))
704 return ret; 705 return ret;