*/
tco_timer_keepalive ();
tco_timer_start ();
- return 0;
+ return nonseekable_open(inode, file);
}
static int i8xx_tco_release (struct inode *inode, struct file *file)
return 0;
}
-static ssize_t i8xx_tco_write (struct file *file, const char *data,
+static ssize_t i8xx_tco_write (struct file *file, const char __user *data,
size_t len, loff_t * ppos)
{
- /* Can't seek (pwrite) on this device */
- if (ppos != &file->f_pos)
- return -ESPIPE;
-
/* See if we got the magic character 'V' and reload the timer */
if (len) {
if (!nowayout) {
{
int new_options, retval = -EINVAL;
int new_heartbeat;
+ void __user *argp = (void __user *)arg;
+ int __user *p = argp;
static struct watchdog_info ident = {
.options = WDIOF_SETTIMEOUT |
WDIOF_KEEPALIVEPING |
switch (cmd) {
case WDIOC_GETSUPPORT:
- return copy_to_user((struct watchdog_info *) arg, &ident,
+ return copy_to_user(argp, &ident,
sizeof (ident)) ? -EFAULT : 0;
case WDIOC_GETSTATUS:
case WDIOC_GETBOOTSTATUS:
- return put_user (0, (int *) arg);
+ return put_user (0, p);
case WDIOC_KEEPALIVE:
tco_timer_keepalive ();
case WDIOC_SETOPTIONS:
{
- if (get_user (new_options, (int *) arg))
+ if (get_user (new_options, p))
return -EFAULT;
if (new_options & WDIOS_DISABLECARD) {
case WDIOC_SETTIMEOUT:
{
- if (get_user(new_heartbeat, (int *) arg))
+ if (get_user(new_heartbeat, p))
return -EFAULT;
if (tco_timer_set_heartbeat(new_heartbeat))
}
case WDIOC_GETTIMEOUT:
- return put_user(heartbeat, (int *)arg);
+ return put_user(heartbeat, p);
default:
return -ENOIOCTLCMD;