drivers/char/lp.c patch

C. Scott Ananian (cananian@lcs.mit.edu)
Sat, 1 Nov 1997 00:21:15 -0500 (EST)


Enclosed is a patch to get drivers/char/lp.c working again with the new
VFS interface. I'd appreciate it if someone double-checked this for
correctness.

diff -ru linux-2.1.61-orig/drivers/char/lp.c linux-2.1.61/drivers/char/lp.c
--- linux-2.1.61-orig/drivers/char/lp.c Sat Sep 20 17:51:54 1997
+++ linux-2.1.61/drivers/char/lp.c Fri Oct 31 22:14:52 1997
@@ -272,9 +272,10 @@
return total_bytes_written;
}

-static long lp_write(struct inode * inode, struct file * file,
- const char * buf, unsigned long count)
+static ssize_t lp_write(struct file * file, const char *buf,
+ size_t count, loff_t *ppos)
{
+ struct inode * inode = file->f_dentry->d_inode;
unsigned int minor = MINOR(inode->i_rdev);
int retv;

@@ -315,9 +316,10 @@
}

/* Status readback confirming to ieee1284 */
-static long lp_read(struct inode * inode, struct file * file,
- char * buf, unsigned long count)
+static ssize_t lp_read(struct file * file, char * buf,
+ size_t count, loff_t * ppos)
{
+ struct inode * inode = file -> f_dentry -> d_inode;
unsigned char z=0, Byte=0, status;
char *temp;
int retval;