aboutsummaryrefslogtreecommitdiff
path: root/drivers/cdrom/cm206.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2006-03-23 03:00:15 -0800
committerLinus Torvalds <torvalds@g5.osdl.org>2006-03-23 07:38:09 -0800
commit6a2900b67652421b51fe25e4b86ecfec742b1f30 (patch)
tree57fd1f624d9e3fdc4b3e0dd637357cc451204250 /drivers/cdrom/cm206.c
parentd2c5d4fc07a41a6048b01d3b2930aeff1235fda5 (diff)
[PATCH] kill cdrom ->dev_ioctl method
Since early 2.4.x all cdrom drivers implement the block_device methods themselves, so they can handle additional ioctls directly instead of going through the cdrom layer. Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-by: Jens Axboe <axboe@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/cdrom/cm206.c')
-rw-r--r--drivers/cdrom/cm206.c44
1 files changed, 16 insertions, 28 deletions
diff --git a/drivers/cdrom/cm206.c b/drivers/cdrom/cm206.c
index ce127f7ec0f..fad27a87ce3 100644
--- a/drivers/cdrom/cm206.c
+++ b/drivers/cdrom/cm206.c
@@ -1157,32 +1157,6 @@ static int cm206_audio_ioctl(struct cdrom_device_info *cdi, unsigned int cmd,
}
}
-/* Ioctl. These ioctls are specific to the cm206 driver. I have made
- some driver statistics accessible through ioctl calls.
- */
-
-static int cm206_ioctl(struct cdrom_device_info *cdi, unsigned int cmd,
- unsigned long arg)
-{
- switch (cmd) {
-#ifdef STATISTICS
- case CM206CTL_GET_STAT:
- if (arg >= NR_STATS)
- return -EINVAL;
- else
- return cd->stats[arg];
- case CM206CTL_GET_LAST_STAT:
- if (arg >= NR_STATS)
- return -EINVAL;
- else
- return cd->last_stat[arg];
-#endif
- default:
- debug(("Unknown ioctl call 0x%x\n", cmd));
- return -EINVAL;
- }
-}
-
static int cm206_media_changed(struct cdrom_device_info *cdi, int disc_nr)
{
if (cd != NULL) {
@@ -1321,11 +1295,10 @@ static struct cdrom_device_ops cm206_dops = {
.get_mcn = cm206_get_upc,
.reset = cm206_reset,
.audio_ioctl = cm206_audio_ioctl,
- .dev_ioctl = cm206_ioctl,
.capability = CDC_CLOSE_TRAY | CDC_OPEN_TRAY | CDC_LOCK |
CDC_MULTI_SESSION | CDC_MEDIA_CHANGED |
CDC_MCN | CDC_PLAY_AUDIO | CDC_SELECT_SPEED |
- CDC_IOCTLS | CDC_DRIVE_STATUS,
+ CDC_DRIVE_STATUS,
.n_minors = 1,
};
@@ -1350,6 +1323,21 @@ static int cm206_block_release(struct inode *inode, struct file *file)
static int cm206_block_ioctl(struct inode *inode, struct file *file,
unsigned cmd, unsigned long arg)
{
+ switch (cmd) {
+#ifdef STATISTICS
+ case CM206CTL_GET_STAT:
+ if (arg >= NR_STATS)
+ return -EINVAL;
+ return cd->stats[arg];
+ case CM206CTL_GET_LAST_STAT:
+ if (arg >= NR_STATS)
+ return -EINVAL;
+ return cd->last_stat[arg];
+#endif
+ default:
+ break;
+ }
+
return cdrom_ioctl(file, &cm206_info, inode, cmd, arg);
}