aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/mips/kernel/rtlx.c11
-rw-r--r--arch/mips/kernel/vpe.c6
2 files changed, 8 insertions, 9 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
399static int file_open(struct inode *inode, struct file *filp) 399static 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
406static int file_release(struct inode *inode, struct file *filp) 406static 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)
438static ssize_t file_read(struct file *file, char __user * buffer, size_t count, 437static 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... */
diff --git a/arch/mips/kernel/vpe.c b/arch/mips/kernel/vpe.c
index 80ffaa6d50ad..85d7df7b18e1 100644
--- a/arch/mips/kernel/vpe.c
+++ b/arch/mips/kernel/vpe.c
@@ -1072,7 +1072,7 @@ static int vpe_open(struct inode *inode, struct file *filp)
1072 struct vpe_notifications *not; 1072 struct vpe_notifications *not;
1073 1073
1074 /* assume only 1 device at the mo. */ 1074 /* assume only 1 device at the mo. */
1075 if ((minor = MINOR(inode->i_rdev)) != 1) { 1075 if ((minor = iminor(inode)) != 1) {
1076 printk(KERN_WARNING "VPE loader: only vpe1 is supported\n"); 1076 printk(KERN_WARNING "VPE loader: only vpe1 is supported\n");
1077 return -ENODEV; 1077 return -ENODEV;
1078 } 1078 }
@@ -1133,7 +1133,7 @@ static int vpe_release(struct inode *inode, struct file *filp)
1133 struct vpe *v; 1133 struct vpe *v;
1134 Elf_Ehdr *hdr; 1134 Elf_Ehdr *hdr;
1135 1135
1136 minor = MINOR(inode->i_rdev); 1136 minor = iminor(inode);
1137 if ((v = get_vpe(minor)) == NULL) 1137 if ((v = get_vpe(minor)) == NULL)
1138 return -ENODEV; 1138 return -ENODEV;
1139 1139
@@ -1174,7 +1174,7 @@ static ssize_t vpe_write(struct file *file, const char __user * buffer,
1174 size_t ret = count; 1174 size_t ret = count;
1175 struct vpe *v; 1175 struct vpe *v;
1176 1176
1177 minor = MINOR(file->f_dentry->d_inode->i_rdev); 1177 minor = iminor(file->f_dentry->d_inode);
1178 if ((v = get_vpe(minor)) == NULL) 1178 if ((v = get_vpe(minor)) == NULL)
1179 return -ENODEV; 1179 return -ENODEV;
1180 1180