aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/sr.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/sr.c')
-rw-r--r--drivers/scsi/sr.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/drivers/scsi/sr.c b/drivers/scsi/sr.c
index 0f17009c99d2..b92e2dac9aa9 100644
--- a/drivers/scsi/sr.c
+++ b/drivers/scsi/sr.c
@@ -480,7 +480,7 @@ static int sr_block_open(struct inode *inode, struct file *file)
480 if(!(cd = scsi_cd_get(disk))) 480 if(!(cd = scsi_cd_get(disk)))
481 return -ENXIO; 481 return -ENXIO;
482 482
483 if((ret = cdrom_open(&cd->cdi, inode, file)) != 0) 483 if((ret = cdrom_open(&cd->cdi, inode->i_bdev, file->f_mode)) != 0)
484 scsi_cd_put(cd); 484 scsi_cd_put(cd);
485 485
486 return ret; 486 return ret;
@@ -488,12 +488,8 @@ static int sr_block_open(struct inode *inode, struct file *file)
488 488
489static int sr_block_release(struct inode *inode, struct file *file) 489static int sr_block_release(struct inode *inode, struct file *file)
490{ 490{
491 int ret;
492 struct scsi_cd *cd = scsi_cd(inode->i_bdev->bd_disk); 491 struct scsi_cd *cd = scsi_cd(inode->i_bdev->bd_disk);
493 ret = cdrom_release(&cd->cdi, file); 492 cdrom_release(&cd->cdi, file ? file->f_mode : 0);
494 if(ret)
495 return ret;
496
497 scsi_cd_put(cd); 493 scsi_cd_put(cd);
498 494
499 return 0; 495 return 0;
@@ -517,7 +513,8 @@ static int sr_block_ioctl(struct inode *inode, struct file *file, unsigned cmd,
517 return scsi_ioctl(sdev, cmd, argp); 513 return scsi_ioctl(sdev, cmd, argp);
518 } 514 }
519 515
520 ret = cdrom_ioctl(file, &cd->cdi, inode, cmd, arg); 516 ret = cdrom_ioctl(&cd->cdi, inode->i_bdev,
517 file ? file->f_mode : 0, cmd, arg);
521 if (ret != -ENOSYS) 518 if (ret != -ENOSYS)
522 return ret; 519 return ret;
523 520