VServer 1.9.2 (patch-2.6.8.1-vs1.9.2.diff)
[linux-2.6.git] / drivers / char / tipar.c
index 8cbf15b..48d7a7c 100644 (file)
@@ -262,7 +262,7 @@ tipar_open(struct inode *inode, struct file *file)
        init_ti_parallel(minor);
        parport_release(table[minor].dev);
 
-       return 0;
+       return nonseekable_open(inode, file);
 }
 
 static int
@@ -279,7 +279,7 @@ tipar_close(struct inode *inode, struct file *file)
 }
 
 static ssize_t
-tipar_write(struct file *file, const char *buf, size_t count, loff_t * ppos)
+tipar_write(struct file *file, const char __user *buf, size_t count, loff_t * ppos)
 {
        unsigned int minor = iminor(file->f_dentry->d_inode) - TIPAR_MINOR;
        ssize_t n;
@@ -306,7 +306,7 @@ tipar_write(struct file *file, const char *buf, size_t count, loff_t * ppos)
 }
 
 static ssize_t
-tipar_read(struct file *file, char *buf, size_t count, loff_t * ppos)
+tipar_read(struct file *file, char __user *buf, size_t count, loff_t * ppos)
 {
        int b = 0;
        unsigned int minor = iminor(file->f_dentry->d_inode) - TIPAR_MINOR;
@@ -316,9 +316,6 @@ tipar_read(struct file *file, char *buf, size_t count, loff_t * ppos)
        if (count == 0)
                return 0;
 
-       if (ppos != &file->f_pos)
-               return -ESPIPE;
-
        parport_claim_or_block(table[minor].dev);
 
        while (n < count) {
@@ -328,7 +325,7 @@ tipar_read(struct file *file, char *buf, size_t count, loff_t * ppos)
                        retval = -ETIMEDOUT;
                        goto out;
                } else {
-                       if (put_user(b, ((unsigned char *) buf) + n)) {
+                       if (put_user(b, buf + n)) {
                                retval = -EFAULT;
                                break;
                        } else