/*
* Now all the various file operations that we export.
*/
-static ssize_t gen_rtc_read(struct file *file, char __user *buf,
+static ssize_t gen_rtc_read(struct file *file, char *buf,
size_t count, loff_t *ppos)
{
DECLARE_WAITQUEUE(wait, current);
/* first test allows optimizer to nuke this case for 32-bit machines */
if (sizeof (int) != sizeof (long) && count == sizeof (unsigned int)) {
unsigned int uidata = data;
- retval = put_user(uidata, (unsigned long __user *)buf);
+ retval = put_user(uidata, (unsigned long *)buf);
}
else {
- retval = put_user(data, (unsigned long __user *)buf);
+ retval = put_user(data, (unsigned long *)buf);
}
if (!retval)
retval = sizeof(unsigned long);
{
struct rtc_time wtime;
struct rtc_pll_info pll;
- void __user *argp = (void __user *)arg;
switch (cmd) {
if (get_rtc_pll(&pll))
return -EINVAL;
else
- return copy_to_user(argp, &pll, sizeof pll) ? -EFAULT : 0;
+ return copy_to_user((void *)arg, &pll, sizeof pll) ? -EFAULT : 0;
case RTC_PLL_SET:
if (!capable(CAP_SYS_TIME))
return -EACCES;
- if (copy_from_user(&pll, argp, sizeof(pll)))
+ if (copy_from_user(&pll, (struct rtc_pll_info*)arg,
+ sizeof(pll)))
return -EFAULT;
return set_rtc_pll(&pll);
memset(&wtime, 0, sizeof(wtime));
get_rtc_time(&wtime);
- return copy_to_user(argp, &wtime, sizeof(wtime)) ? -EFAULT : 0;
+ return copy_to_user((void *)arg, &wtime, sizeof(wtime)) ? -EFAULT : 0;
case RTC_SET_TIME: /* Set the RTC */
{
if (!capable(CAP_SYS_TIME))
return -EACCES;
- if (copy_from_user(&wtime, argp, sizeof(wtime)))
+ if (copy_from_user(&wtime, (struct rtc_time *)arg,
+ sizeof(wtime)))
return -EFAULT;
year = wtime.tm_year + 1900;
{
struct proc_dir_entry *r;
- r = create_proc_read_entry("driver/rtc", 0, NULL, gen_rtc_read_proc, NULL);
+ r = create_proc_read_entry("driver/rtc", 0, 0, gen_rtc_read_proc, NULL);
if (!r)
return -ENOMEM;
return 0;