/[linux-patches]/genpatches-2.6/trunk/2.6.14/1050_4_ls120-eject.patch
Gentoo

Contents of /genpatches-2.6/trunk/2.6.14/1050_4_ls120-eject.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 232 - (show annotations) (download) (as text)
Thu Dec 15 16:22:43 2005 UTC (14 years, 11 months ago) by dsd
File MIME type: text/x-diff
File size: 1881 byte(s)
Linux 2.6.14.4
1 From stable-bounces@linux.kernel.org Mon Dec 12 12:32:46 2005
2 Date: Wed, 9 Nov 2005 21:02:07 -0800
3 Message-Id: <200511100502.jAA527xg006881@hera.kernel.org>
4 From: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
5 To: git-commits-head@vger.kernel.org
6 Cc:
7 Subject: ide-floppy: software eject not working with LS-120 drive
8
9 From: Ondrej Zary <linux@rainbow-software.org>
10
11 The problem (eject not working on ATAPI LS-120 drive) is caused by
12 idefloppy_ioctl() function which *first* tries generic_ide_ioctl()
13 and *only* if it fails with -EINVAL, proceeds with the specific ioctls.
14 The generic eject command fails with something other than -EINVAL
15 and the specific one is never executed.
16
17 This patch fixes it by first going through the internal ioctls
18 and only trying generic_ide_ioctl() if none of them matches.
19
20 Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
21 Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
22 Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
23
24 ---
25 drivers/ide/ide-floppy.c | 6 ++----
26 1 file changed, 2 insertions(+), 4 deletions(-)
27
28 --- linux-2.6.14.3.orig/drivers/ide/ide-floppy.c
29 +++ linux-2.6.14.3/drivers/ide/ide-floppy.c
30 @@ -2038,11 +2038,9 @@ static int idefloppy_ioctl(struct inode
31 struct ide_floppy_obj *floppy = ide_floppy_g(bdev->bd_disk);
32 ide_drive_t *drive = floppy->drive;
33 void __user *argp = (void __user *)arg;
34 - int err = generic_ide_ioctl(drive, file, bdev, cmd, arg);
35 + int err;
36 int prevent = (arg) ? 1 : 0;
37 idefloppy_pc_t pc;
38 - if (err != -EINVAL)
39 - return err;
40
41 switch (cmd) {
42 case CDROMEJECT:
43 @@ -2094,7 +2092,7 @@ static int idefloppy_ioctl(struct inode
44 case IDEFLOPPY_IOCTL_FORMAT_GET_PROGRESS:
45 return idefloppy_get_format_progress(drive, argp);
46 }
47 - return -EINVAL;
48 + return generic_ide_ioctl(drive, file, bdev, cmd, arg);
49 }
50
51 static int idefloppy_media_changed(struct gendisk *disk)

  ViewVC Help
Powered by ViewVC 1.1.20