X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fsbus%2Fchar%2Frtc.c;h=bf3273eb1c8b78764d4b7c563a2585181925e9a4;hb=6a77f38946aaee1cd85eeec6cf4229b204c15071;hp=2d6f684774eca7a14c7e741f22ae10aa4d6dede2;hpb=5273a3df6485dc2ad6aa7ddd441b9a21970f003b;p=linux-2.6.git diff --git a/drivers/sbus/char/rtc.c b/drivers/sbus/char/rtc.c index 2d6f68477..bf3273eb1 100644 --- a/drivers/sbus/char/rtc.c +++ b/drivers/sbus/char/rtc.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -30,7 +31,7 @@ static int rtc_busy = 0; /* Retrieve the current date and time from the real time clock. */ static void get_rtc_time(struct rtc_time *t) { - unsigned long regs = mstk48t02_regs; + void * __iomem regs = mstk48t02_regs; u8 tmp; spin_lock_irq(&mostek_lock); @@ -57,7 +58,7 @@ static void get_rtc_time(struct rtc_time *t) /* Set the current date and time inthe real time clock. */ void set_rtc_time(struct rtc_time *t) { - unsigned long regs = mstk48t02_regs; + void * __iomem regs = mstk48t02_regs; u8 tmp; spin_lock_irq(&mostek_lock); @@ -85,6 +86,7 @@ static int rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) { struct rtc_time rtc_tm; + void __user *argp = (void __user *)arg; switch (cmd) { @@ -92,7 +94,7 @@ static int rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd, memset(&rtc_tm, 0, sizeof(struct rtc_time)); get_rtc_time(&rtc_tm); - if (copy_to_user((struct rtc_time*)arg, &rtc_tm, sizeof(struct rtc_time))) + if (copy_to_user(argp, &rtc_tm, sizeof(struct rtc_time))) return -EFAULT; return 0; @@ -102,7 +104,7 @@ static int rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd, if (!capable(CAP_SYS_TIME)) return -EPERM; - if (copy_from_user(&rtc_tm, (struct rtc_time*)arg, sizeof(struct rtc_time))) + if (copy_from_user(&rtc_tm, argp, sizeof(struct rtc_time))) return -EFAULT; set_rtc_time(&rtc_tm);