This commit was manufactured by cvs2svn to create tag
[linux-2.6.git] / drivers / char / tipar.c
index 48d7a7c..8cbf15b 100644 (file)
@@ -262,7 +262,7 @@ tipar_open(struct inode *inode, struct file *file)
        init_ti_parallel(minor);
        parport_release(table[minor].dev);
 
-       return nonseekable_open(inode, file);
+       return 0;
 }
 
 static int
@@ -279,7 +279,7 @@ tipar_close(struct inode *inode, struct file *file)
 }
 
 static ssize_t
-tipar_write(struct file *file, const char __user *buf, size_t count, loff_t * ppos)
+tipar_write(struct file *file, const char *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 __user *buf, size_t count, loff_t * pp
 }
 
 static ssize_t
-tipar_read(struct file *file, char __user *buf, size_t count, loff_t * ppos)
+tipar_read(struct file *file, char *buf, size_t count, loff_t * ppos)
 {
        int b = 0;
        unsigned int minor = iminor(file->f_dentry->d_inode) - TIPAR_MINOR;
@@ -316,6 +316,9 @@ tipar_read(struct file *file, char __user *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) {
@@ -325,7 +328,7 @@ tipar_read(struct file *file, char __user *buf, size_t count, loff_t * ppos)
                        retval = -ETIMEDOUT;
                        goto out;
                } else {
-                       if (put_user(b, buf + n)) {
+                       if (put_user(b, ((unsigned char *) buf) + n)) {
                                retval = -EFAULT;
                                break;
                        } else