X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fchar%2Fwatchdog%2Fmachzwd.c;h=3782930e6f1f075565e318b10b83b612cb1f92ae;hb=9bf4aaab3e101692164d49b7ca357651eb691cb6;hp=99c6b21b3100fe706c720ee244dc3141e37bb3b9;hpb=db216c3d5e4c040e557a50f8f5d35d5c415e8c1c;p=linux-2.6.git diff --git a/drivers/char/watchdog/machzwd.c b/drivers/char/watchdog/machzwd.c index 99c6b21b3..3782930e6 100644 --- a/drivers/char/watchdog/machzwd.c +++ b/drivers/char/watchdog/machzwd.c @@ -302,13 +302,9 @@ static void zf_ping(unsigned long data) } } -static ssize_t zf_write(struct file *file, const char *buf, size_t count, +static ssize_t zf_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos) { - /* Can't seek (pwrite) on this device */ - if (ppos != &file->f_pos) - return -ESPIPE; - /* See if we got the magic character */ if(count){ @@ -352,15 +348,16 @@ static ssize_t zf_write(struct file *file, const char *buf, size_t count, static int zf_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) { + void __user *argp = (void __user *)arg; + int __user *p = argp; switch(cmd){ case WDIOC_GETSUPPORT: - if (copy_to_user((struct watchdog_info *)arg, - &zf_info, sizeof(zf_info))) + if (copy_to_user(argp, &zf_info, sizeof(zf_info))) return -EFAULT; break; case WDIOC_GETSTATUS: - return put_user(0, (int *) arg); + return put_user(0, p); case WDIOC_KEEPALIVE: zf_ping(0); @@ -388,7 +385,7 @@ static int zf_open(struct inode *inode, struct file *file) zf_timer_on(); - return 0; + return nonseekable_open(inode, file); } static int zf_close(struct inode *inode, struct file *file)