]> git.hungrycats.org Git - linux/commitdiff
[PATCH] ide should check dma_on
authorAlan Cox <alan@lxorguk.ukuu.org.uk>
Fri, 21 Mar 2003 10:32:12 +0000 (02:32 -0800)
committerLinus Torvalds <torvalds@home.transmeta.com>
Fri, 21 Mar 2003 10:32:12 +0000 (02:32 -0800)
drivers/ide/ide.c

index e4df5743e77f10ac01bde1235d7b9fbb8bb07a60..b39311feaa20ceeda95363176a0ab192ca7c3984 100644 (file)
@@ -1255,13 +1255,14 @@ static int set_io_32bit(ide_drive_t *drive, int arg)
 
 static int set_using_dma (ide_drive_t *drive, int arg)
 {
-       if (!drive->driver || !DRIVER(drive)->supports_dma)
+       if (!DRIVER(drive)->supports_dma)
                return -EPERM;
        if (!drive->id || !(drive->id->capability & 1))
                return -EPERM;
        if (HWIF(drive)->ide_dma_check == NULL)
                return -EPERM;
        if (arg) {
+               if (HWIF(drive)->ide_dma_check(drive)) return -EIO;
                if (HWIF(drive)->ide_dma_on(drive)) return -EIO;
        } else {
                if (HWIF(drive)->ide_dma_off(drive)) return -EIO;