linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [resend] [patch] ide-floppy - software eject not working with LS-120 drive
@ 2005-09-28 17:22 Ondrej Zary
  2005-11-09 23:23 ` Bartlomiej Zolnierkiewicz
  0 siblings, 1 reply; 2+ messages in thread
From: Ondrej Zary @ 2005-09-28 17:22 UTC (permalink / raw)
  To: linux-kernel; +Cc: linux-ide

[-- Attachment #1: Type: text/plain, Size: 571 bytes --]

This is a resend because I didn't get any reply before.

The problem (eject not working on ATAPI LS-120 drive) is caused by 
idefloppy_ioctl() function which *first* tries generic_ide_ioctl() and 
*only* if it fails with -EINVAL, proceeds with the specific ioctls. The 
generic eject command fails with something other than -EINVAL and the 
specific one is never executed.
This patch fixes it by first going through the internal ioctls and only
trying generic_ide_ioctl() if none of them matches.

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>

-- 
Ondrej Zary

[-- Attachment #2: ide-floppy-eject.patch --]
[-- Type: text/plain, Size: 799 bytes --]

--- linux-2.6.13-orig/drivers/ide/ide-floppy.c	2005-08-29 01:41:01.000000000 +0200
+++ linux-2.6.13-pentium/drivers/ide/ide-floppy.c	2005-09-04 14:07:53.000000000 +0200
@@ -2038,11 +2038,9 @@
 	struct ide_floppy_obj *floppy = ide_floppy_g(bdev->bd_disk);
 	ide_drive_t *drive = floppy->drive;
 	void __user *argp = (void __user *)arg;
-	int err = generic_ide_ioctl(drive, file, bdev, cmd, arg);
+	int err;
 	int prevent = (arg) ? 1 : 0;
 	idefloppy_pc_t pc;
-	if (err != -EINVAL)
-		return err;
 
 	switch (cmd) {
 	case CDROMEJECT:
@@ -2094,7 +2092,7 @@
 	case IDEFLOPPY_IOCTL_FORMAT_GET_PROGRESS:
 		return idefloppy_get_format_progress(drive, argp);
 	}
- 	return -EINVAL;
+	return generic_ide_ioctl(drive, file, bdev, cmd, arg);
 }
 
 static int idefloppy_media_changed(struct gendisk *disk)




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-11-09 23:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-09-28 17:22 [resend] [patch] ide-floppy - software eject not working with LS-120 drive Ondrej Zary
2005-11-09 23:23 ` Bartlomiej Zolnierkiewicz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).