aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/input')
-rw-r--r--drivers/input/misc/hp_sdc_rtc.c34
1 files changed, 24 insertions, 10 deletions
diff --git a/drivers/input/misc/hp_sdc_rtc.c b/drivers/input/misc/hp_sdc_rtc.c
index ad730e15afc0..e00a1cc79c0a 100644
--- a/drivers/input/misc/hp_sdc_rtc.c
+++ b/drivers/input/misc/hp_sdc_rtc.c
@@ -43,6 +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/semaphore.h> 47#include <linux/semaphore.h>
47 48
48MODULE_AUTHOR("Brian S. Julin <bri@calyx.com>"); 49MODULE_AUTHOR("Brian S. Julin <bri@calyx.com>");
@@ -64,8 +65,8 @@ static DECLARE_WAIT_QUEUE_HEAD(hp_sdc_rtc_wait);
64static ssize_t hp_sdc_rtc_read(struct file *file, char __user *buf, 65static ssize_t hp_sdc_rtc_read(struct file *file, char __user *buf,
65 size_t count, loff_t *ppos); 66 size_t count, loff_t *ppos);
66 67
67static int hp_sdc_rtc_ioctl(struct inode *inode, struct file *file, 68static long hp_sdc_rtc_unlocked_ioctl(struct file *file,
68 unsigned int cmd, unsigned long arg); 69 unsigned int cmd, unsigned long arg);
69 70
70static unsigned int hp_sdc_rtc_poll(struct file *file, poll_table *wait); 71static unsigned int hp_sdc_rtc_poll(struct file *file, poll_table *wait);
71 72
@@ -512,7 +513,7 @@ static int hp_sdc_rtc_read_proc(char *page, char **start, off_t off,
512 return len; 513 return len;
513} 514}
514 515
515static int hp_sdc_rtc_ioctl(struct inode *inode, struct file *file, 516static int hp_sdc_rtc_ioctl(struct file *file,
516 unsigned int cmd, unsigned long arg) 517 unsigned int cmd, unsigned long arg)
517{ 518{
518#if 1 519#if 1
@@ -659,14 +660,27 @@ static int hp_sdc_rtc_ioctl(struct inode *inode, struct file *file,
659#endif 660#endif
660} 661}
661 662
663static long hp_sdc_rtc_unlocked_ioctl(struct file *file,
664 unsigned int cmd, unsigned long arg)
665{
666 int ret;
667
668 lock_kernel();
669 ret = hp_sdc_rtc_ioctl(file, cmd, arg);
670 unlock_kernel();
671
672 return ret;
673}
674
675
662static const struct file_operations hp_sdc_rtc_fops = { 676static const struct file_operations hp_sdc_rtc_fops = {
663 .owner = THIS_MODULE, 677 .owner = THIS_MODULE,
664 .llseek = no_llseek, 678 .llseek = no_llseek,
665 .read = hp_sdc_rtc_read, 679 .read = hp_sdc_rtc_read,
666 .poll = hp_sdc_rtc_poll, 680 .poll = hp_sdc_rtc_poll,
667 .ioctl = hp_sdc_rtc_ioctl, 681 .unlocked_ioctl = hp_sdc_rtc_ioctl,
668 .open = hp_sdc_rtc_open, 682 .open = hp_sdc_rtc_open,
669 .fasync = hp_sdc_rtc_fasync, 683 .fasync = hp_sdc_rtc_fasync,
670}; 684};
671 685
672static struct miscdevice hp_sdc_rtc_dev = { 686static struct miscdevice hp_sdc_rtc_dev = {