diff options
Diffstat (limited to 'drivers/ide/ide-cd.c')
-rw-r--r-- | drivers/ide/ide-cd.c | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c index 13265a8827da..133afd09843c 100644 --- a/drivers/ide/ide-cd.c +++ b/drivers/ide/ide-cd.c | |||
@@ -2089,17 +2089,15 @@ static ide_driver_t ide_cdrom_driver = { | |||
2089 | #endif | 2089 | #endif |
2090 | }; | 2090 | }; |
2091 | 2091 | ||
2092 | static int idecd_open(struct inode *inode, struct file *file) | 2092 | static int idecd_open(struct block_device *bdev, fmode_t mode) |
2093 | { | 2093 | { |
2094 | struct gendisk *disk = inode->i_bdev->bd_disk; | 2094 | struct cdrom_info *info = ide_cd_get(bdev->bd_disk); |
2095 | struct cdrom_info *info; | ||
2096 | int rc = -ENOMEM; | 2095 | int rc = -ENOMEM; |
2097 | 2096 | ||
2098 | info = ide_cd_get(disk); | ||
2099 | if (!info) | 2097 | if (!info) |
2100 | return -ENXIO; | 2098 | return -ENXIO; |
2101 | 2099 | ||
2102 | rc = cdrom_open(&info->devinfo, inode, file); | 2100 | rc = cdrom_open(&info->devinfo, bdev, mode); |
2103 | 2101 | ||
2104 | if (rc < 0) | 2102 | if (rc < 0) |
2105 | ide_cd_put(info); | 2103 | ide_cd_put(info); |
@@ -2107,12 +2105,11 @@ static int idecd_open(struct inode *inode, struct file *file) | |||
2107 | return rc; | 2105 | return rc; |
2108 | } | 2106 | } |
2109 | 2107 | ||
2110 | static int idecd_release(struct inode *inode, struct file *file) | 2108 | static int idecd_release(struct gendisk *disk, fmode_t mode) |
2111 | { | 2109 | { |
2112 | struct gendisk *disk = inode->i_bdev->bd_disk; | ||
2113 | struct cdrom_info *info = ide_drv_g(disk, cdrom_info); | 2110 | struct cdrom_info *info = ide_drv_g(disk, cdrom_info); |
2114 | 2111 | ||
2115 | cdrom_release(&info->devinfo, file); | 2112 | cdrom_release(&info->devinfo, mode); |
2116 | 2113 | ||
2117 | ide_cd_put(info); | 2114 | ide_cd_put(info); |
2118 | 2115 | ||
@@ -2158,10 +2155,9 @@ static int idecd_get_spindown(struct cdrom_device_info *cdi, unsigned long arg) | |||
2158 | return 0; | 2155 | return 0; |
2159 | } | 2156 | } |
2160 | 2157 | ||
2161 | static int idecd_ioctl(struct inode *inode, struct file *file, | 2158 | static int idecd_ioctl(struct block_device *bdev, fmode_t mode, |
2162 | unsigned int cmd, unsigned long arg) | 2159 | unsigned int cmd, unsigned long arg) |
2163 | { | 2160 | { |
2164 | struct block_device *bdev = inode->i_bdev; | ||
2165 | struct cdrom_info *info = ide_drv_g(bdev->bd_disk, cdrom_info); | 2161 | struct cdrom_info *info = ide_drv_g(bdev->bd_disk, cdrom_info); |
2166 | int err; | 2162 | int err; |
2167 | 2163 | ||
@@ -2174,9 +2170,9 @@ static int idecd_ioctl(struct inode *inode, struct file *file, | |||
2174 | break; | 2170 | break; |
2175 | } | 2171 | } |
2176 | 2172 | ||
2177 | err = generic_ide_ioctl(info->drive, file, bdev, cmd, arg); | 2173 | err = generic_ide_ioctl(info->drive, bdev, cmd, arg); |
2178 | if (err == -EINVAL) | 2174 | if (err == -EINVAL) |
2179 | err = cdrom_ioctl(file, &info->devinfo, inode, cmd, arg); | 2175 | err = cdrom_ioctl(&info->devinfo, bdev, mode, cmd, arg); |
2180 | 2176 | ||
2181 | return err; | 2177 | return err; |
2182 | } | 2178 | } |
@@ -2201,7 +2197,7 @@ static struct block_device_operations idecd_ops = { | |||
2201 | .owner = THIS_MODULE, | 2197 | .owner = THIS_MODULE, |
2202 | .open = idecd_open, | 2198 | .open = idecd_open, |
2203 | .release = idecd_release, | 2199 | .release = idecd_release, |
2204 | .ioctl = idecd_ioctl, | 2200 | .locked_ioctl = idecd_ioctl, |
2205 | .media_changed = idecd_media_changed, | 2201 | .media_changed = idecd_media_changed, |
2206 | .revalidate_disk = idecd_revalidate_disk | 2202 | .revalidate_disk = idecd_revalidate_disk |
2207 | }; | 2203 | }; |