summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/sr.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2007-10-07 17:54:28 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2008-10-21 07:47:22 -0400
commitbbc1cc978404105da23d505163ce9fd5598ed5b1 (patch)
treecd0e1dfba91288338784dac3f9356aeadb3e713e /drivers/scsi/sr.c
parent08f85851215100d0eebf026810955ee6ad456c38 (diff)
[PATCH] switch cdrom_{open,release,ioctl} to sane APIs
... convert to it in callers Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
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 0f17009c99d..b92e2dac9aa 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)
if(!(cd = scsi_cd_get(disk)))
return -ENXIO;
- if((ret = cdrom_open(&cd->cdi, inode, file)) != 0)
+ if((ret = cdrom_open(&cd->cdi, inode->i_bdev, file->f_mode)) != 0)
scsi_cd_put(cd);
return ret;
@@ -488,12 +488,8 @@ static int sr_block_open(struct inode *inode, struct file *file)
static int sr_block_release(struct inode *inode, struct file *file)
{
- int ret;
struct scsi_cd *cd = scsi_cd(inode->i_bdev->bd_disk);
- ret = cdrom_release(&cd->cdi, file);
- if(ret)
- return ret;
-
+ cdrom_release(&cd->cdi, file ? file->f_mode : 0);
scsi_cd_put(cd);
return 0;
@@ -517,7 +513,8 @@ static int sr_block_ioctl(struct inode *inode, struct file *file, unsigned cmd,
return scsi_ioctl(sdev, cmd, argp);
}
- ret = cdrom_ioctl(file, &cd->cdi, inode, cmd, arg);
+ ret = cdrom_ioctl(&cd->cdi, inode->i_bdev,
+ file ? file->f_mode : 0, cmd, arg);
if (ret != -ENOSYS)
return ret;