diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2006-04-24 17:15:10 +0100 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2006-04-27 15:13:50 +0100 |
commit | 79e55bcf24ad8f31c3021b6ef21c4ce054fe4e38 (patch) | |
tree | 0ae54b1c72fb3f02013d0324e32c5693888e43c5 /arch/mips/kernel/rtlx.c | |
parent | b775565952ab8f33a49bfcb2c6dcfaba1e82dee3 (diff) | |
download | op-kernel-dev-79e55bcf24ad8f31c3021b6ef21c4ce054fe4e38.zip op-kernel-dev-79e55bcf24ad8f31c3021b6ef21c4ce054fe4e38.tar.gz |
[MIPS] Cleanup inode->r_dev usage.
imajor()/iminor() should be used instead of accessing r_dev directly.
Based on patch from Eric Sesterhenn (snakebyte@gmx.de).
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/kernel/rtlx.c')
-rw-r--r-- | arch/mips/kernel/rtlx.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/arch/mips/kernel/rtlx.c b/arch/mips/kernel/rtlx.c index 6179805..caf777f 100644 --- a/arch/mips/kernel/rtlx.c +++ b/arch/mips/kernel/rtlx.c @@ -398,15 +398,14 @@ ssize_t rtlx_write(int index, void *buffer, size_t count, int user) static int file_open(struct inode *inode, struct file *filp) { - int minor = MINOR(inode->i_rdev); + int minor = iminor(inode); return rtlx_open(minor, (filp->f_flags & O_NONBLOCK) ? 0 : 1); } static int file_release(struct inode *inode, struct file *filp) { - int minor; - minor = MINOR(inode->i_rdev); + int minor = iminor(inode); return rtlx_release(minor); } @@ -416,7 +415,7 @@ static unsigned int file_poll(struct file *file, poll_table * wait) int minor; unsigned int mask = 0; - minor = MINOR(file->f_dentry->d_inode->i_rdev); + minor = iminor(file->f_dentry->d_inode); poll_wait(file, &channel_wqs[minor].rt_queue, wait); poll_wait(file, &channel_wqs[minor].lx_queue, wait); @@ -438,7 +437,7 @@ static unsigned int file_poll(struct file *file, poll_table * wait) static ssize_t file_read(struct file *file, char __user * buffer, size_t count, loff_t * ppos) { - int minor = MINOR(file->f_dentry->d_inode->i_rdev); + int minor = iminor(file->f_dentry->d_inode); /* data available? */ if (!rtlx_read_poll(minor, (file->f_flags & O_NONBLOCK) ? 0 : 1)) { @@ -455,7 +454,7 @@ static ssize_t file_write(struct file *file, const char __user * buffer, struct rtlx_channel *rt; DECLARE_WAITQUEUE(wait, current); - minor = MINOR(file->f_dentry->d_inode->i_rdev); + minor = iminor(file->f_dentry->d_inode); rt = &rtlx->channel[minor]; /* any space left... */ |