diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2015-04-03 15:14:42 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2015-04-11 22:29:39 -0400 |
commit | 79ff50c09eee690985e178417b36d7128ece8b68 (patch) | |
tree | d834fc4645dc6a87812b16b478bc47e7f7c24a17 | |
parent | e145286685fe6a9eb3f984832b0667d0407081b1 (diff) | |
download | op-kernel-dev-79ff50c09eee690985e178417b36d7128ece8b68.zip op-kernel-dev-79ff50c09eee690985e178417b36d7128ece8b68.tar.gz |
serial2002: switch to __vfs_read/__vfs_write
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r-- | drivers/staging/comedi/drivers/serial2002.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/drivers/staging/comedi/drivers/serial2002.c b/drivers/staging/comedi/drivers/serial2002.c index 71226ee..a7f170e 100644 --- a/drivers/staging/comedi/drivers/serial2002.c +++ b/drivers/staging/comedi/drivers/serial2002.c @@ -110,24 +110,16 @@ static int serial2002_tty_write(struct file *f, unsigned char *buf, int count) { const char __user *p = (__force const char __user *)buf; int result; + loff_t offset = 0; mm_segment_t oldfs; oldfs = get_fs(); set_fs(KERNEL_DS); - f->f_pos = 0; - result = f->f_op->write(f, p, count, &f->f_pos); + result = __vfs_write(f, p, count, &offset); set_fs(oldfs); return result; } -static int serial2002_tty_readb(struct file *f, unsigned char *buf) -{ - char __user *p = (__force char __user *)buf; - - f->f_pos = 0; - return f->f_op->read(f, p, 1, &f->f_pos); -} - static void serial2002_tty_read_poll_wait(struct file *f, int timeout) { struct poll_wqueues table; @@ -163,13 +155,15 @@ static int serial2002_tty_read(struct file *f, int timeout) result = -1; if (!IS_ERR(f)) { mm_segment_t oldfs; + char __user *p = (__force char __user *)&ch; + loff_t offset = 0; oldfs = get_fs(); set_fs(KERNEL_DS); if (f->f_op->poll) { serial2002_tty_read_poll_wait(f, timeout); - if (serial2002_tty_readb(f, &ch) == 1) + if (__vfs_read(f, p, 1, &offset) == 1) result = ch; } else { /* Device does not support poll, busy wait */ @@ -180,7 +174,7 @@ static int serial2002_tty_read(struct file *f, int timeout) if (retries >= timeout) break; - if (serial2002_tty_readb(f, &ch) == 1) { + if (__vfs_read(f, p, 1, &offset) == 1) { result = ch; break; } |