]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/ide/mips/au1xxx-ide.c
ide: make void and rename ide_dma_timeout() method
[linux-2.6-omap-h63xx.git] / drivers / ide / mips / au1xxx-ide.c
index b431b990426d04bd4a5900520e6b48585659341e..405903c42ba15cf0eb6023c78be0ed8d6f9d8b3b 100644 (file)
@@ -29,8 +29,6 @@
  * Note: for more information, please refer "AMD Alchemy Au1200/Au1550 IDE
  *       Interface and Linux Device Driver" Application Note.
  */
-#undef REALLY_SLOW_IO           /* most systems can safely undef this */
-
 #include <linux/types.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
@@ -414,9 +412,9 @@ static int auide_dma_check(ide_drive_t *drive)
        speed = ide_find_best_mode(drive, XFER_PIO | XFER_MWDMA);
        
        if (drive->autodma && (speed & XFER_MODE) != XFER_PIO)
-               return HWIF(drive)->ide_dma_on(drive);
+               return 0;
 
-       return HWIF(drive)->ide_dma_off_quietly(drive);
+       return -1;
 }
 
 static int auide_dma_test_irq(ide_drive_t *drive)
@@ -438,33 +436,29 @@ static int auide_dma_test_irq(ide_drive_t *drive)
        return 0;
 }
 
-static int auide_dma_host_on(ide_drive_t *drive)
+static void auide_dma_host_on(ide_drive_t *drive)
 {
-       return 0;
 }
 
 static int auide_dma_on(ide_drive_t *drive)
 {
        drive->using_dma = 1;
-       return auide_dma_host_on(drive);
-}
 
+       return 0;
+}
 
-static int auide_dma_host_off(ide_drive_t *drive)
+static void auide_dma_host_off(ide_drive_t *drive)
 {
-       return 0;
 }
 
-static int auide_dma_off_quietly(ide_drive_t *drive)
+static void auide_dma_off_quietly(ide_drive_t *drive)
 {
        drive->using_dma = 0;
-       return auide_dma_host_off(drive);
 }
 
-static int auide_dma_lostirq(ide_drive_t *drive)
+static void auide_dma_lost_irq(ide_drive_t *drive)
 {
        printk(KERN_ERR "%s: IRQ lost\n", drive->name);
-       return 0;
 }
 
 static void auide_ddma_tx_callback(int irq, void *param)
@@ -494,16 +488,16 @@ static void auide_init_dbdma_dev(dbdev_tab_t *dev, u32 dev_id, u32 tsize, u32 de
   
 #if defined(CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA)
 
-static int auide_dma_timeout(ide_drive_t *drive)
+static void auide_dma_timeout(ide_drive_t *drive)
 {
-//      printk("%s\n", __FUNCTION__);
+       ide_hwif_t *hwif = HWIF(drive);
 
        printk(KERN_ERR "%s: DMA timeout occurred: ", drive->name);
 
-       if (HWIF(drive)->ide_dma_test_irq(drive))
-               return 0;
+       if (hwif->ide_dma_test_irq(drive))
+               return;
 
-       return HWIF(drive)->ide_dma_end(drive);
+       hwif->ide_dma_end(drive);
 }
                                        
 
@@ -644,6 +638,7 @@ static int au_ide_probe(struct device *dev)
        _auide_hwif *ahwif = &auide_hwif;
        ide_hwif_t *hwif;
        struct resource *res;
+       hw_regs_t *hw;
        int ret = 0;
 
 #if defined(CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA)
@@ -686,7 +681,7 @@ static int au_ide_probe(struct device *dev)
        /* FIXME:  This might possibly break PCMCIA IDE devices */
 
        hwif                            = &ide_hwifs[pdev->id];
-       hw_regs_t *hw                   = &hwif->hw;
+       hw                              = &hwif->hw;
        hwif->irq = hw->irq             = ahwif->irq;
        hwif->chipset                   = ide_au1xxx;
 
@@ -724,8 +719,8 @@ static int au_ide_probe(struct device *dev)
        hwif->speedproc                 = &auide_tune_chipset;
 
 #ifdef CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA
-       hwif->ide_dma_off_quietly       = &auide_dma_off_quietly;
-       hwif->ide_dma_timeout           = &auide_dma_timeout;
+       hwif->dma_off_quietly           = &auide_dma_off_quietly;
+       hwif->dma_timeout               = &auide_dma_timeout;
 
        hwif->ide_dma_check             = &auide_dma_check;
        hwif->dma_exec_cmd              = &auide_dma_exec_cmd;
@@ -733,9 +728,9 @@ static int au_ide_probe(struct device *dev)
        hwif->ide_dma_end               = &auide_dma_end;
        hwif->dma_setup                 = &auide_dma_setup;
        hwif->ide_dma_test_irq          = &auide_dma_test_irq;
-       hwif->ide_dma_host_off          = &auide_dma_host_off;
-       hwif->ide_dma_host_on           = &auide_dma_host_on;
-       hwif->ide_dma_lostirq           = &auide_dma_lostirq;
+       hwif->dma_host_off              = &auide_dma_host_off;
+       hwif->dma_host_on               = &auide_dma_host_on;
+       hwif->dma_lost_irq              = &auide_dma_lost_irq;
        hwif->ide_dma_on                = &auide_dma_on;
 
        hwif->autodma                   = 1;
@@ -764,6 +759,9 @@ static int au_ide_probe(struct device *dev)
 #endif
 
        probe_hwif_init(hwif);
+
+       ide_proc_register_port(hwif);
+
        dev_set_drvdata(dev, hwif);
 
        printk(KERN_INFO "Au1xxx IDE(builtin) configured for %s\n", mode );