Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
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);
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);
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);
}
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;
}