diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2006-04-24 12:15:10 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2006-04-27 10:13:50 -0400 |
commit | 79e55bcf24ad8f31c3021b6ef21c4ce054fe4e38 (patch) | |
tree | 0ae54b1c72fb3f02013d0324e32c5693888e43c5 /arch/mips/kernel/rtlx.c | |
parent | b775565952ab8f33a49bfcb2c6dcfaba1e82dee3 (diff) |
[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 6179805af9f0..caf777f83289 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) | |||
398 | 398 | ||
399 | static int file_open(struct inode *inode, struct file *filp) | 399 | static int file_open(struct inode *inode, struct file *filp) |
400 | { | 400 | { |
401 | int minor = MINOR(inode->i_rdev); | 401 | int minor = iminor(inode); |
402 | 402 | ||
403 | return rtlx_open(minor, (filp->f_flags & O_NONBLOCK) ? 0 : 1); | 403 | return rtlx_open(minor, (filp->f_flags & O_NONBLOCK) ? 0 : 1); |
404 | } | 404 | } |
405 | 405 | ||
406 | static int file_release(struct inode *inode, struct file *filp) | 406 | static int file_release(struct inode *inode, struct file *filp) |
407 | { | 407 | { |
408 | int minor; | 408 | int minor = iminor(inode); |
409 | minor = MINOR(inode->i_rdev); | ||
410 | 409 | ||
411 | return rtlx_release(minor); | 410 | return rtlx_release(minor); |
412 | } | 411 | } |
@@ -416,7 +415,7 @@ static unsigned int file_poll(struct file *file, poll_table * wait) | |||
416 | int minor; | 415 | int minor; |
417 | unsigned int mask = 0; | 416 | unsigned int mask = 0; |
418 | 417 | ||
419 | minor = MINOR(file->f_dentry->d_inode->i_rdev); | 418 | minor = iminor(file->f_dentry->d_inode); |
420 | 419 | ||
421 | poll_wait(file, &channel_wqs[minor].rt_queue, wait); | 420 | poll_wait(file, &channel_wqs[minor].rt_queue, wait); |
422 | poll_wait(file, &channel_wqs[minor].lx_queue, wait); | 421 | poll_wait(file, &channel_wqs[minor].lx_queue, wait); |
@@ -438,7 +437,7 @@ static unsigned int file_poll(struct file *file, poll_table * wait) | |||
438 | static ssize_t file_read(struct file *file, char __user * buffer, size_t count, | 437 | static ssize_t file_read(struct file *file, char __user * buffer, size_t count, |
439 | loff_t * ppos) | 438 | loff_t * ppos) |
440 | { | 439 | { |
441 | int minor = MINOR(file->f_dentry->d_inode->i_rdev); | 440 | int minor = iminor(file->f_dentry->d_inode); |
442 | 441 | ||
443 | /* data available? */ | 442 | /* data available? */ |
444 | if (!rtlx_read_poll(minor, (file->f_flags & O_NONBLOCK) ? 0 : 1)) { | 443 | 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, | |||
455 | struct rtlx_channel *rt; | 454 | struct rtlx_channel *rt; |
456 | DECLARE_WAITQUEUE(wait, current); | 455 | DECLARE_WAITQUEUE(wait, current); |
457 | 456 | ||
458 | minor = MINOR(file->f_dentry->d_inode->i_rdev); | 457 | minor = iminor(file->f_dentry->d_inode); |
459 | rt = &rtlx->channel[minor]; | 458 | rt = &rtlx->channel[minor]; |
460 | 459 | ||
461 | /* any space left... */ | 460 | /* any space left... */ |