]> err.no Git - linux-2.6/blobdiff - drivers/ide/ide-dma.c
usb ethernet gadget, workaround network stack API glitch
[linux-2.6] / drivers / ide / ide-dma.c
index 4fbcea4c10256db9061dfee75c488cde8bdaedc7..fd213088b06b4a467afc8222a87fd634f100cfe3 100644 (file)
@@ -414,72 +414,68 @@ static int dma_timer_expiry (ide_drive_t *drive)
 }
 
 /**
- *     __ide_dma_host_off      -       Generic DMA kill
+ *     ide_dma_host_off        -       Generic DMA kill
  *     @drive: drive to control
  *
  *     Perform the generic IDE controller DMA off operation. This
  *     works for most IDE bus mastering controllers
  */
 
-int __ide_dma_host_off (ide_drive_t *drive)
+void ide_dma_host_off(ide_drive_t *drive)
 {
        ide_hwif_t *hwif        = HWIF(drive);
        u8 unit                 = (drive->select.b.unit & 0x01);
        u8 dma_stat             = hwif->INB(hwif->dma_status);
 
        hwif->OUTB((dma_stat & ~(1<<(5+unit))), hwif->dma_status);
-       return 0;
 }
 
-EXPORT_SYMBOL(__ide_dma_host_off);
+EXPORT_SYMBOL(ide_dma_host_off);
 
 /**
- *     __ide_dma_host_off_quietly      -       Generic DMA kill
+ *     ide_dma_off_quietly     -       Generic DMA kill
  *     @drive: drive to control
  *
  *     Turn off the current DMA on this IDE controller. 
  */
 
-int __ide_dma_off_quietly (ide_drive_t *drive)
+void ide_dma_off_quietly(ide_drive_t *drive)
 {
        drive->using_dma = 0;
        ide_toggle_bounce(drive, 0);
 
-       if (HWIF(drive)->ide_dma_host_off(drive))
-               return 1;
-
-       return 0;
+       drive->hwif->dma_host_off(drive);
 }
 
-EXPORT_SYMBOL(__ide_dma_off_quietly);
+EXPORT_SYMBOL(ide_dma_off_quietly);
 #endif /* CONFIG_BLK_DEV_IDEDMA_PCI */
 
 /**
- *     __ide_dma_off   -       disable DMA on a device
+ *     ide_dma_off     -       disable DMA on a device
  *     @drive: drive to disable DMA on
  *
  *     Disable IDE DMA for a device on this IDE controller.
  *     Inform the user that DMA has been disabled.
  */
 
-int __ide_dma_off (ide_drive_t *drive)
+void ide_dma_off(ide_drive_t *drive)
 {
        printk(KERN_INFO "%s: DMA disabled\n", drive->name);
-       return HWIF(drive)->ide_dma_off_quietly(drive);
+       drive->hwif->dma_off_quietly(drive);
 }
 
-EXPORT_SYMBOL(__ide_dma_off);
+EXPORT_SYMBOL(ide_dma_off);
 
 #ifdef CONFIG_BLK_DEV_IDEDMA_PCI
 /**
- *     __ide_dma_host_on       -       Enable DMA on a host
+ *     ide_dma_host_on -       Enable DMA on a host
  *     @drive: drive to enable for DMA
  *
  *     Enable DMA on an IDE controller following generic bus mastering
  *     IDE controller behaviour
  */
-int __ide_dma_host_on (ide_drive_t *drive)
+
+void ide_dma_host_on(ide_drive_t *drive)
 {
        if (drive->using_dma) {
                ide_hwif_t *hwif        = HWIF(drive);
@@ -487,12 +483,10 @@ int __ide_dma_host_on (ide_drive_t *drive)
                u8 dma_stat             = hwif->INB(hwif->dma_status);
 
                hwif->OUTB((dma_stat|(1<<(5+unit))), hwif->dma_status);
-               return 0;
        }
-       return 1;
 }
 
-EXPORT_SYMBOL(__ide_dma_host_on);
+EXPORT_SYMBOL(ide_dma_host_on);
 
 /**
  *     __ide_dma_on            -       Enable DMA on a device
@@ -510,8 +504,7 @@ int __ide_dma_on (ide_drive_t *drive)
        drive->using_dma = 1;
        ide_toggle_bounce(drive, 1);
 
-       if (HWIF(drive)->ide_dma_host_on(drive))
-               return 1;
+       drive->hwif->dma_host_on(drive);
 
        return 0;
 }
@@ -758,7 +751,7 @@ void ide_dma_verbose(ide_drive_t *drive)
        return;
 bug_dma_off:
        printk(", BUG DMA OFF");
-       hwif->ide_dma_off_quietly(drive);
+       hwif->dma_off_quietly(drive);
        return;
 }
 
@@ -773,7 +766,8 @@ int ide_set_dma(ide_drive_t *drive)
 
        switch(rc) {
        case -1: /* DMA needs to be disabled */
-               return hwif->ide_dma_off_quietly(drive);
+               hwif->dma_off_quietly(drive);
+               return -1;
        case  0: /* DMA needs to be enabled */
                return hwif->ide_dma_on(drive);
        case  1: /* DMA setting cannot be changed */
@@ -937,14 +931,14 @@ void ide_setup_dma (ide_hwif_t *hwif, unsigned long dma_base, unsigned int num_p
        if (!(hwif->dma_prdtable))
                hwif->dma_prdtable      = (hwif->dma_base + 4);
 
-       if (!hwif->ide_dma_off_quietly)
-               hwif->ide_dma_off_quietly = &__ide_dma_off_quietly;
-       if (!hwif->ide_dma_host_off)
-               hwif->ide_dma_host_off = &__ide_dma_host_off;
+       if (!hwif->dma_off_quietly)
+               hwif->dma_off_quietly = &ide_dma_off_quietly;
+       if (!hwif->dma_host_off)
+               hwif->dma_host_off = &ide_dma_host_off;
        if (!hwif->ide_dma_on)
                hwif->ide_dma_on = &__ide_dma_on;
-       if (!hwif->ide_dma_host_on)
-               hwif->ide_dma_host_on = &__ide_dma_host_on;
+       if (!hwif->dma_host_on)
+               hwif->dma_host_on = &ide_dma_host_on;
        if (!hwif->ide_dma_check)
                hwif->ide_dma_check = &__ide_dma_check;
        if (!hwif->dma_setup)