aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/ide/ide-floppy.c18
-rw-r--r--drivers/ide/ide.c4
2 files changed, 17 insertions, 5 deletions
diff --git a/drivers/ide/ide-floppy.c b/drivers/ide/ide-floppy.c
index a21f585b1caa..ae8e1a64b8ad 100644
--- a/drivers/ide/ide-floppy.c
+++ b/drivers/ide/ide-floppy.c
@@ -99,6 +99,8 @@
99#include <linux/bitops.h> 99#include <linux/bitops.h>
100#include <linux/mutex.h> 100#include <linux/mutex.h>
101 101
102#include <scsi/scsi_ioctl.h>
103
102#include <asm/byteorder.h> 104#include <asm/byteorder.h>
103#include <asm/irq.h> 105#include <asm/irq.h>
104#include <asm/uaccess.h> 106#include <asm/uaccess.h>
@@ -2099,7 +2101,21 @@ static int idefloppy_ioctl(struct inode *inode, struct file *file,
2099 case IDEFLOPPY_IOCTL_FORMAT_GET_PROGRESS: 2101 case IDEFLOPPY_IOCTL_FORMAT_GET_PROGRESS:
2100 return idefloppy_get_format_progress(drive, argp); 2102 return idefloppy_get_format_progress(drive, argp);
2101 } 2103 }
2102 return generic_ide_ioctl(drive, file, bdev, cmd, arg); 2104
2105 /*
2106 * skip SCSI_IOCTL_SEND_COMMAND (deprecated)
2107 * and CDROM_SEND_PACKET (legacy) ioctls
2108 */
2109 if (cmd != CDROM_SEND_PACKET && cmd != SCSI_IOCTL_SEND_COMMAND)
2110 err = scsi_cmd_ioctl(file, bdev->bd_disk->queue,
2111 bdev->bd_disk, cmd, argp);
2112 else
2113 err = -ENOTTY;
2114
2115 if (err == -ENOTTY)
2116 err = generic_ide_ioctl(drive, file, bdev, cmd, arg);
2117
2118 return err;
2103} 2119}
2104 2120
2105static int idefloppy_media_changed(struct gendisk *disk) 2121static int idefloppy_media_changed(struct gendisk *disk)
diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c
index c438cc314238..5e88a060df06 100644
--- a/drivers/ide/ide.c
+++ b/drivers/ide/ide.c
@@ -1097,10 +1097,6 @@ int generic_ide_ioctl(ide_drive_t *drive, struct file *file, struct block_device
1097 return 0; 1097 return 0;
1098 } 1098 }
1099 1099
1100 case CDROMEJECT:
1101 case CDROMCLOSETRAY:
1102 return scsi_cmd_ioctl(file, bdev->bd_disk->queue, bdev->bd_disk, cmd, p);
1103
1104 case HDIO_GET_BUSSTATE: 1100 case HDIO_GET_BUSSTATE:
1105 if (!capable(CAP_SYS_ADMIN)) 1101 if (!capable(CAP_SYS_ADMIN))
1106 return -EACCES; 1102 return -EACCES;