[PATCH] switch pktcdvd to blkdev_driver_ioctl()
authorAl Viro <viro@zeniv.linux.org.uk>
Wed, 29 Aug 2007 04:56:32 +0000 (00:56 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Tue, 21 Oct 2008 11:47:24 +0000 (07:47 -0400)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
drivers/block/pktcdvd.c

index 4d581e8ba9f6357b0035dba82ac74959e6917fea..bdd49abcb546da1ff5d43c5c61c600f3cda4565d 100644 (file)
@@ -2803,6 +2803,14 @@ static int pkt_ioctl(struct inode *inode, struct file *file, unsigned int cmd, u
        VPRINTK("pkt_ioctl: cmd %x, dev %d:%d\n", cmd, imajor(inode), iminor(inode));
 
        switch (cmd) {
+       case CDROMEJECT:
+               /*
+                * The door gets locked when the device is opened, so we
+                * have to unlock it or else the eject command fails.
+                */
+               if (pd->refcnt == 1)
+                       pkt_lock_door(pd, 0);
+               /* fallthru */
        /*
         * forward selected CDROM ioctls to CD-ROM, for UDF
         */
@@ -2811,16 +2819,8 @@ static int pkt_ioctl(struct inode *inode, struct file *file, unsigned int cmd, u
        case CDROM_LAST_WRITTEN:
        case CDROM_SEND_PACKET:
        case SCSI_IOCTL_SEND_COMMAND:
-               return blkdev_ioctl(pd->bdev->bd_inode, file, cmd, arg);
-
-       case CDROMEJECT:
-               /*
-                * The door gets locked when the device is opened, so we
-                * have to unlock it or else the eject command fails.
-                */
-               if (pd->refcnt == 1)
-                       pkt_lock_door(pd, 0);
-               return blkdev_ioctl(pd->bdev->bd_inode, file, cmd, arg);
+               return blkdev_driver_ioctl(pd->bdev->bd_inode, pd->bdev->bd_disk,
+                                       file, cmd, arg);
 
        default:
                VPRINTK(DRIVER_NAME": Unknown ioctl for %s (%x)\n", pd->name, cmd);