PATCH: ide should check dma_on

From: Alan Cox (alan@lxorguk.ukuu.org.uk)
Date: Fri Mar 21 2003 - 15:44:07 EST


diff -u --new-file --recursive --exclude-from /usr/src/exclude linux-2.5.65/drivers/ide/ide.c linux-2.5.65-ac2/drivers/ide/ide.c
--- linux-2.5.65/drivers/ide/ide.c 2003-03-03 19:20:09.000000000 +0000
+++ linux-2.5.65-ac2/drivers/ide/ide.c 2003-03-20 18:23:19.000000000 +0000
@@ -1255,13 +1284,14 @@
 
 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;
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun Mar 23 2003 - 22:00:38 EST