]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/ide/ide-dma.c
ide: make ide_dma_timeout() available also for CONFIG_BLK_DEV_IDEDMA_SFF=n
[linux-2.6-omap-h63xx.git] / drivers / ide / ide-dma.c
index 1185f5a4c15456596454a53aaacded1b95ad451f..244b61b573ce4700f5662f80739bf0fc5851ea05 100644 (file)
@@ -370,7 +370,7 @@ static int dma_timer_expiry (ide_drive_t *drive)
 void ide_dma_host_set(ide_drive_t *drive, int on)
 {
        ide_hwif_t *hwif        = HWIF(drive);
-       u8 unit                 = (drive->select.b.unit & 0x01);
+       u8 unit                 = drive->dn & 1;
        u8 dma_stat             = hwif->tp_ops->read_sff_dma_status(hwif);
 
        if (on)
@@ -531,7 +531,7 @@ void ide_dma_start(ide_drive_t *drive)
 EXPORT_SYMBOL_GPL(ide_dma_start);
 
 /* returns 1 on error, 0 otherwise */
-int __ide_dma_end (ide_drive_t *drive)
+int ide_dma_end(ide_drive_t *drive)
 {
        ide_hwif_t *hwif = drive->hwif;
        u8 mmio = (hwif->host_flags & IDE_HFLAG_MMIO) ? 1 : 0;
@@ -566,8 +566,7 @@ int __ide_dma_end (ide_drive_t *drive)
        wmb();
        return (dma_stat & 7) != 4 ? (0x10 | dma_stat) : 0;
 }
-
-EXPORT_SYMBOL(__ide_dma_end);
+EXPORT_SYMBOL_GPL(ide_dma_end);
 
 /* returns 1 if dma irq issued, 0 otherwise */
 int ide_dma_test_irq(ide_drive_t *drive)
@@ -578,9 +577,7 @@ int ide_dma_test_irq(ide_drive_t *drive)
        /* return 1 if INTR asserted */
        if ((dma_stat & 4) == 4)
                return 1;
-       if (!drive->waiting_for_dma)
-               printk(KERN_WARNING "%s: (%s) called while not waiting\n",
-                       drive->name, __func__);
+
        return 0;
 }
 EXPORT_SYMBOL_GPL(ide_dma_test_irq);
@@ -826,15 +823,13 @@ void ide_check_dma_crc(ide_drive_t *drive)
                ide_dma_on(drive);
 }
 
-#ifdef CONFIG_BLK_DEV_IDEDMA_SFF
-void ide_dma_lost_irq (ide_drive_t *drive)
+void ide_dma_lost_irq(ide_drive_t *drive)
 {
-       printk("%s: DMA interrupt recovery\n", drive->name);
+       printk(KERN_ERR "%s: DMA interrupt recovery\n", drive->name);
 }
+EXPORT_SYMBOL_GPL(ide_dma_lost_irq);
 
-EXPORT_SYMBOL(ide_dma_lost_irq);
-
-void ide_dma_timeout (ide_drive_t *drive)
+void ide_dma_timeout(ide_drive_t *drive)
 {
        ide_hwif_t *hwif = HWIF(drive);
 
@@ -843,11 +838,13 @@ void ide_dma_timeout (ide_drive_t *drive)
        if (hwif->dma_ops->dma_test_irq(drive))
                return;
 
+       ide_dump_status(drive, "DMA timeout", hwif->tp_ops->read_status(hwif));
+
        hwif->dma_ops->dma_end(drive);
 }
+EXPORT_SYMBOL_GPL(ide_dma_timeout);
 
-EXPORT_SYMBOL(ide_dma_timeout);
-
+#ifdef CONFIG_BLK_DEV_IDEDMA_SFF
 void ide_release_dma_engine(ide_hwif_t *hwif)
 {
        if (hwif->dmatable_cpu) {
@@ -882,7 +879,7 @@ const struct ide_dma_ops sff_dma_ops = {
        .dma_setup              = ide_dma_setup,
        .dma_exec_cmd           = ide_dma_exec_cmd,
        .dma_start              = ide_dma_start,
-       .dma_end                = __ide_dma_end,
+       .dma_end                = ide_dma_end,
        .dma_test_irq           = ide_dma_test_irq,
        .dma_timeout            = ide_dma_timeout,
        .dma_lost_irq           = ide_dma_lost_irq,