aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/rtc.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@infradead.org>2008-07-27 11:25:57 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-07-27 11:25:57 -0400
commit50cb993ea6cd187bfed085cb3e0747066edeb02f (patch)
tree61edac62c6c5bc07c59e4369c50c6821ad77f2c0 /drivers/char/rtc.c
parent445c2714cf72817ab1ad3ca894c6d9b2047b3a3e (diff)
parent8be1a6d6c77ab4532e4476fdb8177030ef48b52c (diff)
Merge ../linux-2.6
Diffstat (limited to 'drivers/char/rtc.c')
-rw-r--r--drivers/char/rtc.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/drivers/char/rtc.c b/drivers/char/rtc.c
index fa92a8af5a5a..d9799e2bcfbf 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,8 @@ 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); 147static void rtc_get_rtc_time(struct rtc_time *rtc_tm);
149 148
150#ifdef RTC_IRQ 149#ifdef RTC_IRQ
151static unsigned int rtc_poll(struct file *file, poll_table *wait); 150static unsigned int rtc_poll(struct file *file, poll_table *wait);
@@ -237,7 +236,7 @@ static inline unsigned char rtc_is_updating(void)
237 * (See ./arch/XXXX/kernel/time.c for the set_rtc_mmss() function.) 236 * (See ./arch/XXXX/kernel/time.c for the set_rtc_mmss() function.)
238 */ 237 */
239 238
240irqreturn_t rtc_interrupt(int irq, void *dev_id) 239static irqreturn_t rtc_interrupt(int irq, void *dev_id)
241{ 240{
242 /* 241 /*
243 * Can be an alarm interrupt, update complete interrupt, 242 * Can be an alarm interrupt, update complete interrupt,
@@ -719,10 +718,13 @@ static int rtc_do_ioctl(unsigned int cmd, unsigned long arg, int kernel)
719 &wtime, sizeof wtime) ? -EFAULT : 0; 718 &wtime, sizeof wtime) ? -EFAULT : 0;
720} 719}
721 720
722static int rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd, 721static long rtc_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
723 unsigned long arg)
724{ 722{
725 return rtc_do_ioctl(cmd, arg, 0); 723 long ret;
724 lock_kernel();
725 ret = rtc_do_ioctl(cmd, arg, 0);
726 unlock_kernel();
727 return ret;
726} 728}
727 729
728/* 730/*
@@ -915,7 +917,7 @@ static const struct file_operations rtc_fops = {
915#ifdef RTC_IRQ 917#ifdef RTC_IRQ
916 .poll = rtc_poll, 918 .poll = rtc_poll,
917#endif 919#endif
918 .ioctl = rtc_ioctl, 920 .unlocked_ioctl = rtc_ioctl,
919 .open = rtc_open, 921 .open = rtc_open,
920 .release = rtc_release, 922 .release = rtc_release,
921 .fasync = rtc_fasync, 923 .fasync = rtc_fasync,
@@ -1302,7 +1304,7 @@ static int rtc_proc_open(struct inode *inode, struct file *file)
1302} 1304}
1303#endif 1305#endif
1304 1306
1305void rtc_get_rtc_time(struct rtc_time *rtc_tm) 1307static void rtc_get_rtc_time(struct rtc_time *rtc_tm)
1306{ 1308{
1307 unsigned long uip_watchdog = jiffies, flags; 1309 unsigned long uip_watchdog = jiffies, flags;
1308 unsigned char ctrl; 1310 unsigned char ctrl;