2002-01-02 01:27:03

by Jeff Garzik

[permalink] [raw]
Subject: PATCH 2.5.2.6: fix lp, ppdev builds

? drivers/char/conmakehash
? drivers/char/consolemap_deftbl.c
Index: drivers/char/lp.c
===================================================================
RCS file: /cvsroot/gkernel/linux_2_5/drivers/char/lp.c,v
retrieving revision 1.2
diff -u -r1.2 lp.c
--- drivers/char/lp.c 2001/11/30 01:10:57 1.2
+++ drivers/char/lp.c 2002/01/02 01:15:40
@@ -294,7 +294,7 @@
static ssize_t lp_write(struct file * file, const char * buf,
size_t count, loff_t *ppos)
{
- unsigned int minor = MINOR(file->f_dentry->d_inode->i_rdev);
+ unsigned int minor = minor(file->f_dentry->d_inode->i_rdev);
struct parport *port = lp_table[minor].dev->port;
char *kbuf = lp_table[minor].lp_buffer;
ssize_t retv = 0;
@@ -403,7 +403,7 @@
static ssize_t lp_read(struct file * file, char * buf,
size_t count, loff_t *ppos)
{
- unsigned int minor=MINOR(file->f_dentry->d_inode->i_rdev);
+ unsigned int minor=minor(file->f_dentry->d_inode->i_rdev);
struct parport *port = lp_table[minor].dev->port;
ssize_t retval = 0;
char *kbuf = lp_table[minor].lp_buffer;
@@ -430,7 +430,7 @@

static int lp_open(struct inode * inode, struct file * file)
{
- unsigned int minor = MINOR(inode->i_rdev);
+ unsigned int minor = minor(inode->i_rdev);

if (minor >= LP_NO)
return -ENXIO;
@@ -488,7 +488,7 @@

static int lp_release(struct inode * inode, struct file * file)
{
- unsigned int minor = MINOR(inode->i_rdev);
+ unsigned int minor = minor(inode->i_rdev);

lp_claim_parport_or_block (&lp_table[minor]);
parport_negotiate (lp_table[minor].dev->port, IEEE1284_MODE_COMPAT);
@@ -503,7 +503,7 @@
static int lp_ioctl(struct inode *inode, struct file *file,
unsigned int cmd, unsigned long arg)
{
- unsigned int minor = MINOR(inode->i_rdev);
+ unsigned int minor = minor(inode->i_rdev);
int status;
int retval = 0;

Index: drivers/char/ppdev.c
===================================================================
RCS file: /cvsroot/gkernel/linux_2_5/drivers/char/ppdev.c,v
retrieving revision 1.2
diff -u -r1.2 ppdev.c
--- drivers/char/ppdev.c 2001/11/30 01:10:57 1.2
+++ drivers/char/ppdev.c 2002/01/02 01:15:40
@@ -103,7 +103,7 @@
static ssize_t pp_read (struct file * file, char * buf, size_t count,
loff_t * ppos)
{
- unsigned int minor = MINOR (file->f_dentry->d_inode->i_rdev);
+ unsigned int minor = minor (file->f_dentry->d_inode->i_rdev);
struct pp_struct *pp = file->private_data;
char * kbuffer;
ssize_t bytes_read = 0;
@@ -183,7 +183,7 @@
static ssize_t pp_write (struct file * file, const char * buf, size_t count,
loff_t * ppos)
{
- unsigned int minor = MINOR (file->f_dentry->d_inode->i_rdev);
+ unsigned int minor = minor (file->f_dentry->d_inode->i_rdev);
struct pp_struct *pp = file->private_data;
char * kbuffer;
ssize_t bytes_written = 0;
@@ -315,7 +315,7 @@
static int pp_ioctl(struct inode *inode, struct file *file,
unsigned int cmd, unsigned long arg)
{
- unsigned int minor = MINOR(inode->i_rdev);
+ unsigned int minor = minor(inode->i_rdev);
struct pp_struct *pp = file->private_data;
struct parport * port;

@@ -613,7 +613,7 @@

static int pp_open (struct inode * inode, struct file * file)
{
- unsigned int minor = MINOR (inode->i_rdev);
+ unsigned int minor = minor (inode->i_rdev);
struct pp_struct *pp;

if (minor >= PARPORT_MAX)
@@ -642,7 +642,7 @@

static int pp_release (struct inode * inode, struct file * file)
{
- unsigned int minor = MINOR (inode->i_rdev);
+ unsigned int minor = minor (inode->i_rdev);
struct pp_struct *pp = file->private_data;
int compat_negot;


Attachments:
lp-2.5.2.6.patch (3.49 kB)