aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-floppy_ioctl.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ide/ide-floppy_ioctl.c')
-rw-r--r--drivers/ide/ide-floppy_ioctl.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/drivers/ide/ide-floppy_ioctl.c b/drivers/ide/ide-floppy_ioctl.c
index 5af70a2c9ef8..2bc51ff73fee 100644
--- a/drivers/ide/ide-floppy_ioctl.c
+++ b/drivers/ide/ide-floppy_ioctl.c
@@ -241,7 +241,7 @@ static int ide_floppy_lockdoor(ide_drive_t *drive, struct ide_atapi_pc *pc,
241 return 0; 241 return 0;
242} 242}
243 243
244static int ide_floppy_format_ioctl(ide_drive_t *drive, struct file *file, 244static int ide_floppy_format_ioctl(ide_drive_t *drive, fmode_t mode,
245 unsigned int cmd, void __user *argp) 245 unsigned int cmd, void __user *argp)
246{ 246{
247 switch (cmd) { 247 switch (cmd) {
@@ -250,7 +250,7 @@ static int ide_floppy_format_ioctl(ide_drive_t *drive, struct file *file,
250 case IDEFLOPPY_IOCTL_FORMAT_GET_CAPACITY: 250 case IDEFLOPPY_IOCTL_FORMAT_GET_CAPACITY:
251 return ide_floppy_get_format_capacities(drive, argp); 251 return ide_floppy_get_format_capacities(drive, argp);
252 case IDEFLOPPY_IOCTL_FORMAT_START: 252 case IDEFLOPPY_IOCTL_FORMAT_START:
253 if (!(file->f_mode & FMODE_WRITE)) 253 if (!(mode & FMODE_WRITE))
254 return -EPERM; 254 return -EPERM;
255 return ide_floppy_format_unit(drive, (int __user *)argp); 255 return ide_floppy_format_unit(drive, (int __user *)argp);
256 case IDEFLOPPY_IOCTL_FORMAT_GET_PROGRESS: 256 case IDEFLOPPY_IOCTL_FORMAT_GET_PROGRESS:
@@ -260,10 +260,9 @@ static int ide_floppy_format_ioctl(ide_drive_t *drive, struct file *file,
260 } 260 }
261} 261}
262 262
263int ide_floppy_ioctl(ide_drive_t *drive, struct inode *inode, 263int ide_floppy_ioctl(ide_drive_t *drive, struct block_device *bdev,
264 struct file *file, unsigned int cmd, unsigned long arg) 264 fmode_t mode, unsigned int cmd, unsigned long arg)
265{ 265{
266 struct block_device *bdev = inode->i_bdev;
267 struct ide_atapi_pc pc; 266 struct ide_atapi_pc pc;
268 void __user *argp = (void __user *)arg; 267 void __user *argp = (void __user *)arg;
269 int err; 268 int err;
@@ -271,7 +270,7 @@ int ide_floppy_ioctl(ide_drive_t *drive, struct inode *inode,
271 if (cmd == CDROMEJECT || cmd == CDROM_LOCKDOOR) 270 if (cmd == CDROMEJECT || cmd == CDROM_LOCKDOOR)
272 return ide_floppy_lockdoor(drive, &pc, arg, cmd); 271 return ide_floppy_lockdoor(drive, &pc, arg, cmd);
273 272
274 err = ide_floppy_format_ioctl(drive, file, cmd, argp); 273 err = ide_floppy_format_ioctl(drive, mode, cmd, argp);
275 if (err != -ENOTTY) 274 if (err != -ENOTTY)
276 return err; 275 return err;
277 276
@@ -281,7 +280,7 @@ int ide_floppy_ioctl(ide_drive_t *drive, struct inode *inode,
281 */ 280 */
282 if (cmd != CDROM_SEND_PACKET && cmd != SCSI_IOCTL_SEND_COMMAND) 281 if (cmd != CDROM_SEND_PACKET && cmd != SCSI_IOCTL_SEND_COMMAND)
283 err = scsi_cmd_ioctl(bdev->bd_disk->queue, bdev->bd_disk, 282 err = scsi_cmd_ioctl(bdev->bd_disk->queue, bdev->bd_disk,
284 file ? file->f_mode : 0, cmd, argp); 283 mode, cmd, argp);
285 284
286 if (err == -ENOTTY) 285 if (err == -ENOTTY)
287 err = generic_ide_ioctl(drive, bdev, cmd, arg); 286 err = generic_ide_ioctl(drive, bdev, cmd, arg);