]> err.no Git - linux-2.6/commitdiff
ide: move drive->using_dma check to callers of ->dma_host_on method
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Sat, 26 Jan 2008 19:13:02 +0000 (20:13 +0100)
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Sat, 26 Jan 2008 19:13:02 +0000 (20:13 +0100)
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
drivers/ide/ide-dma.c
drivers/ide/ide-iops.c
drivers/ide/pci/cs5520.c
drivers/ide/pci/sc1200.c

index edd0018c49887b33ba62e4c6050766ce86d2152a..780911e0537e516c20f1c78c19f63d96e47667f7 100644 (file)
@@ -471,7 +471,7 @@ EXPORT_SYMBOL(ide_dma_off);
 
 void ide_dma_host_on(ide_drive_t *drive)
 {
-       if (drive->using_dma) {
+       if (1) {
                ide_hwif_t *hwif        = HWIF(drive);
                u8 unit                 = (drive->select.b.unit & 0x01);
                u8 dma_stat             = hwif->INB(hwif->dma_status);
index 76cb5f2bd4e6d9a077bb61799a0dac8ddde15889..e30f67e09b9c28c6b2f1d1d93c6e4f6cfe4bef2e 100644 (file)
@@ -799,7 +799,8 @@ int ide_config_drive_speed(ide_drive_t *drive, u8 speed)
 
  skip:
 #ifdef CONFIG_BLK_DEV_IDEDMA
-       if (speed >= XFER_SW_DMA_0 || (hwif->host_flags & IDE_HFLAG_VDMA))
+       if ((speed >= XFER_SW_DMA_0 || (hwif->host_flags & IDE_HFLAG_VDMA)) &&
+           drive->using_dma)
                hwif->dma_host_on(drive);
        else if (hwif->dma_host_on)     /* check if host supports DMA */
                ide_dma_off_quietly(drive);
index 78058ca2ce769e2e667de5ddef78a25ae5ffb5db..2bd52af83d37d9c8110ef72bd672cd111f1753f1 100644 (file)
@@ -109,8 +109,7 @@ static void cs5520_set_dma_mode(ide_drive_t *drive, const u8 speed)
 
 static void cs5520_dma_host_on(ide_drive_t *drive)
 {
-       if (drive->using_dma)
-               drive->vdma = 1;
+       drive->vdma = 1;
 
        ide_dma_host_on(drive);
 }
index 8a94c3e8f7c4ed24e97c6d3ca029346cdd0fa4fc..9303dfee7780a4507f1edc9fd94db0669d7e71e1 100644 (file)
@@ -221,7 +221,7 @@ static void sc1200_set_pio_mode(ide_drive_t *drive, const u8 pio)
        if (mode != -1) {
                printk("SC1200: %s: changing (U)DMA mode\n", drive->name);
                ide_dma_off_quietly(drive);
-               if (ide_set_dma_mode(drive, mode) == 0)
+               if (ide_set_dma_mode(drive, mode) == 0 && drive->using_dma)
                        hwif->dma_host_on(drive);
                return;
        }