diff options
-rw-r--r-- | drivers/char/rtc.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/drivers/char/rtc.c b/drivers/char/rtc.c index fa92a8af5a5a..d1569a0d0506 100644 --- a/drivers/char/rtc.c +++ b/drivers/char/rtc.c | |||
@@ -78,9 +78,10 @@ | |||
78 | #include <linux/wait.h> | 78 | #include <linux/wait.h> |
79 | #include <linux/bcd.h> | 79 | #include <linux/bcd.h> |
80 | #include <linux/delay.h> | 80 | #include <linux/delay.h> |
81 | #include <linux/smp_lock.h> | ||
82 | #include <linux/uaccess.h> | ||
81 | 83 | ||
82 | #include <asm/current.h> | 84 | #include <asm/current.h> |
83 | #include <asm/uaccess.h> | ||
84 | #include <asm/system.h> | 85 | #include <asm/system.h> |
85 | 86 | ||
86 | #ifdef CONFIG_X86 | 87 | #ifdef CONFIG_X86 |
@@ -144,8 +145,7 @@ static DEFINE_TIMER(rtc_irq_timer, rtc_dropped_irq, 0, 0); | |||
144 | static ssize_t rtc_read(struct file *file, char __user *buf, | 145 | static ssize_t rtc_read(struct file *file, char __user *buf, |
145 | size_t count, loff_t *ppos); | 146 | size_t count, loff_t *ppos); |
146 | 147 | ||
147 | static int rtc_ioctl(struct inode *inode, struct file *file, | 148 | static long rtc_ioctl(struct file *file, unsigned int cmd, unsigned long arg); |
148 | unsigned int cmd, unsigned long arg); | ||
149 | 149 | ||
150 | #ifdef RTC_IRQ | 150 | #ifdef RTC_IRQ |
151 | static unsigned int rtc_poll(struct file *file, poll_table *wait); | 151 | static unsigned int rtc_poll(struct file *file, poll_table *wait); |
@@ -719,10 +719,13 @@ static int rtc_do_ioctl(unsigned int cmd, unsigned long arg, int kernel) | |||
719 | &wtime, sizeof wtime) ? -EFAULT : 0; | 719 | &wtime, sizeof wtime) ? -EFAULT : 0; |
720 | } | 720 | } |
721 | 721 | ||
722 | static int rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd, | 722 | static long rtc_ioctl(struct file *file, unsigned int cmd, unsigned long arg) |
723 | unsigned long arg) | ||
724 | { | 723 | { |
725 | return rtc_do_ioctl(cmd, arg, 0); | 724 | long ret; |
725 | lock_kernel(); | ||
726 | ret = rtc_do_ioctl(cmd, arg, 0); | ||
727 | unlock_kernel(); | ||
728 | return ret; | ||
726 | } | 729 | } |
727 | 730 | ||
728 | /* | 731 | /* |
@@ -915,7 +918,7 @@ static const struct file_operations rtc_fops = { | |||
915 | #ifdef RTC_IRQ | 918 | #ifdef RTC_IRQ |
916 | .poll = rtc_poll, | 919 | .poll = rtc_poll, |
917 | #endif | 920 | #endif |
918 | .ioctl = rtc_ioctl, | 921 | .unlocked_ioctl = rtc_ioctl, |
919 | .open = rtc_open, | 922 | .open = rtc_open, |
920 | .release = rtc_release, | 923 | .release = rtc_release, |
921 | .fasync = rtc_fasync, | 924 | .fasync = rtc_fasync, |