aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/kernel/rtlx.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/mips/kernel/rtlx.c')
-rw-r--r--arch/mips/kernel/rtlx.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/arch/mips/kernel/rtlx.c b/arch/mips/kernel/rtlx.c
index b8c18dcdd2c4..88f7b50d541c 100644
--- a/arch/mips/kernel/rtlx.c
+++ b/arch/mips/kernel/rtlx.c
@@ -399,11 +399,9 @@ static int file_release(struct inode *inode, struct file *filp)
399 399
400static unsigned int file_poll(struct file *file, poll_table * wait) 400static unsigned int file_poll(struct file *file, poll_table * wait)
401{ 401{
402 int minor; 402 int minor = iminor(file_inode(file));
403 unsigned int mask = 0; 403 unsigned int mask = 0;
404 404
405 minor = iminor(file->f_path.dentry->d_inode);
406
407 poll_wait(file, &channel_wqs[minor].rt_queue, wait); 405 poll_wait(file, &channel_wqs[minor].rt_queue, wait);
408 poll_wait(file, &channel_wqs[minor].lx_queue, wait); 406 poll_wait(file, &channel_wqs[minor].lx_queue, wait);
409 407
@@ -424,7 +422,7 @@ static unsigned int file_poll(struct file *file, poll_table * wait)
424static ssize_t file_read(struct file *file, char __user * buffer, size_t count, 422static ssize_t file_read(struct file *file, char __user * buffer, size_t count,
425 loff_t * ppos) 423 loff_t * ppos)
426{ 424{
427 int minor = iminor(file->f_path.dentry->d_inode); 425 int minor = iminor(file_inode(file));
428 426
429 /* data available? */ 427 /* data available? */
430 if (!rtlx_read_poll(minor, (file->f_flags & O_NONBLOCK) ? 0 : 1)) { 428 if (!rtlx_read_poll(minor, (file->f_flags & O_NONBLOCK) ? 0 : 1)) {
@@ -437,11 +435,8 @@ static ssize_t file_read(struct file *file, char __user * buffer, size_t count,
437static ssize_t file_write(struct file *file, const char __user * buffer, 435static ssize_t file_write(struct file *file, const char __user * buffer,
438 size_t count, loff_t * ppos) 436 size_t count, loff_t * ppos)
439{ 437{
440 int minor; 438 int minor = iminor(file_inode(file));
441 struct rtlx_channel *rt; 439 struct rtlx_channel *rt = &rtlx->channel[minor];
442
443 minor = iminor(file->f_path.dentry->d_inode);
444 rt = &rtlx->channel[minor];
445 440
446 /* any space left... */ 441 /* any space left... */
447 if (!rtlx_write_poll(minor)) { 442 if (!rtlx_write_poll(minor)) {