#include <linux/poll.h>
#include <linux/init.h>
#include <linux/smp_lock.h>
+#include <asm/io.h>
#include <asm/mostek.h>
#include <asm/system.h>
#include <asm/uaccess.h>
/* 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);
/* 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);
unsigned long arg)
{
struct rtc_time rtc_tm;
+ void __user *argp = (void __user *)arg;
switch (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;
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);