sgiioc4: fix sgiioc4_ide_dma_check() to enable/disable DMA properly
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Sat, 17 Feb 2007 01:40:26 +0000 (02:40 +0100)
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Sat, 17 Feb 2007 01:40:26 +0000 (02:40 +0100)
* use sgiioc4_ide_dma_{on,off_quietly}() instead of changing
  drive->using_dma directly
* fix warning message
* add FIXME

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
drivers/ide/pci/sgiioc4.c

index 083c7afe11624f3e14f90758ad1eed0f17fe2e9e..290697e09e5599c7aebd3671ec62dfa4e9a15c43 100644 (file)
@@ -274,21 +274,6 @@ sgiioc4_ide_dma_end(ide_drive_t * drive)
        return dma_stat;
 }
 
-static int
-sgiioc4_ide_dma_check(ide_drive_t * drive)
-{
-       if (ide_config_drive_speed(drive, XFER_MW_DMA_2) != 0) {
-               printk(KERN_INFO
-                      "Couldnot set %s in Multimode-2 DMA mode | "
-                          "Drive %s using PIO instead\n",
-                      drive->name, drive->name);
-               drive->using_dma = 0;
-       } else
-               drive->using_dma = 1;
-
-       return 0;
-}
-
 static int
 sgiioc4_ide_dma_on(ide_drive_t * drive)
 {
@@ -305,6 +290,17 @@ sgiioc4_ide_dma_off_quietly(ide_drive_t * drive)
        return HWIF(drive)->ide_dma_host_off(drive);
 }
 
+static int sgiioc4_ide_dma_check(ide_drive_t *drive)
+{
+       /* FIXME: check for available DMA modes */
+       if (ide_config_drive_speed(drive, XFER_MW_DMA_2) != 0) {
+               printk(KERN_WARNING "%s: couldn't set MWDMA2 mode, "
+                                   "using PIO instead\n", drive->name);
+               return sgiioc4_ide_dma_off_quietly(drive);
+       } else
+               return sgiioc4_ide_dma_on(drive);
+}
+
 /* returns 1 if dma irq issued, 0 otherwise */
 static int
 sgiioc4_ide_dma_test_irq(ide_drive_t * drive)