aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/rtc.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/char/rtc.c')
-rw-r--r--drivers/char/rtc.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/drivers/char/rtc.c b/drivers/char/rtc.c
index fa92a8af5a5a..dbefbb30ed44 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
@@ -120,8 +121,6 @@ static irqreturn_t hpet_rtc_interrupt(int irq, void *dev_id)
120 return 0; 121 return 0;
121} 122}
122#endif 123#endif
123#else
124extern irqreturn_t hpet_rtc_interrupt(int irq, void *dev_id);
125#endif 124#endif
126 125
127/* 126/*
@@ -144,8 +143,7 @@ static DEFINE_TIMER(rtc_irq_timer, rtc_dropped_irq, 0, 0);
144static ssize_t rtc_read(struct file *file, char __user *buf, 143static ssize_t rtc_read(struct file *file, char __user *buf,
145 size_t count, loff_t *ppos); 144 size_t count, loff_t *ppos);
146 145
147static int rtc_ioctl(struct inode *inode, struct file *file, 146static long rtc_ioctl(struct file *file, unsigned int cmd, unsigned long arg);
148 unsigned int cmd, unsigned long arg);
149 147
150#ifdef RTC_IRQ 148#ifdef RTC_IRQ
151static unsigned int rtc_poll(struct file *file, poll_table *wait); 149static unsigned int rtc_poll(struct file *file, poll_table *wait);
@@ -719,10 +717,13 @@ static int rtc_do_ioctl(unsigned int cmd, unsigned long arg, int kernel)
719 &wtime, sizeof wtime) ? -EFAULT : 0; 717 &wtime, sizeof wtime) ? -EFAULT : 0;
720} 718}
721 719
722static int rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd, 720static long rtc_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
723 unsigned long arg)
724{ 721{
725 return rtc_do_ioctl(cmd, arg, 0); 722 long ret;
723 lock_kernel();
724 ret = rtc_do_ioctl(cmd, arg, 0);
725 unlock_kernel();
726 return ret;
726} 727}
727 728
728/* 729/*
@@ -915,7 +916,7 @@ static const struct file_operations rtc_fops = {
915#ifdef RTC_IRQ 916#ifdef RTC_IRQ
916 .poll = rtc_poll, 917 .poll = rtc_poll,
917#endif 918#endif
918 .ioctl = rtc_ioctl, 919 .unlocked_ioctl = rtc_ioctl,
919 .open = rtc_open, 920 .open = rtc_open,
920 .release = rtc_release, 921 .release = rtc_release,
921 .fasync = rtc_fasync, 922 .fasync = rtc_fasync,