ide: move drive->using_dma check to callers of ->dma_host_on method

Acked-by: default avatarSergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
parent 8ae60e34
...@@ -471,7 +471,7 @@ EXPORT_SYMBOL(ide_dma_off); ...@@ -471,7 +471,7 @@ EXPORT_SYMBOL(ide_dma_off);
void ide_dma_host_on(ide_drive_t *drive) void ide_dma_host_on(ide_drive_t *drive)
{ {
if (drive->using_dma) { if (1) {
ide_hwif_t *hwif = HWIF(drive); ide_hwif_t *hwif = HWIF(drive);
u8 unit = (drive->select.b.unit & 0x01); u8 unit = (drive->select.b.unit & 0x01);
u8 dma_stat = hwif->INB(hwif->dma_status); u8 dma_stat = hwif->INB(hwif->dma_status);
......
...@@ -799,7 +799,8 @@ int ide_config_drive_speed(ide_drive_t *drive, u8 speed) ...@@ -799,7 +799,8 @@ int ide_config_drive_speed(ide_drive_t *drive, u8 speed)
skip: skip:
#ifdef CONFIG_BLK_DEV_IDEDMA #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); hwif->dma_host_on(drive);
else if (hwif->dma_host_on) /* check if host supports DMA */ else if (hwif->dma_host_on) /* check if host supports DMA */
ide_dma_off_quietly(drive); ide_dma_off_quietly(drive);
......
...@@ -109,7 +109,6 @@ static void cs5520_set_dma_mode(ide_drive_t *drive, const u8 speed) ...@@ -109,7 +109,6 @@ static void cs5520_set_dma_mode(ide_drive_t *drive, const u8 speed)
static void cs5520_dma_host_on(ide_drive_t *drive) 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); ide_dma_host_on(drive);
......
...@@ -221,7 +221,7 @@ static void sc1200_set_pio_mode(ide_drive_t *drive, const u8 pio) ...@@ -221,7 +221,7 @@ static void sc1200_set_pio_mode(ide_drive_t *drive, const u8 pio)
if (mode != -1) { if (mode != -1) {
printk("SC1200: %s: changing (U)DMA mode\n", drive->name); printk("SC1200: %s: changing (U)DMA mode\n", drive->name);
ide_dma_off_quietly(drive); 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); hwif->dma_host_on(drive);
return; return;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment