IDE: Remove references to dead ETRAX-related variables.
[powerpc.git] / drivers / ide / cris / ide-cris.c
index 6b2d152..e8cd86e 100644 (file)
@@ -17,8 +17,6 @@
  * device can't do DMA handshaking for some stupid reason. We don't need to do that.
  */
 
-#undef REALLY_SLOW_IO           /* most systems can safely undef this */
-
 #include <linux/types.h>
 #include <linux/kernel.h>
 #include <linux/timer.h>
@@ -416,12 +414,6 @@ cris_ide_reset(unsigned val)
 #ifdef CONFIG_ETRAX_IDE_G27_RESET
        REG_SHADOW_SET(R_PORT_G_DATA, port_g_data_shadow, 27, val);
 #endif
-#ifdef CONFIG_ETRAX_IDE_CSE1_16_RESET
-       REG_SHADOW_SET(port_cse1_addr, port_cse1_shadow, 16, val);
-#endif
-#ifdef CONFIG_ETRAX_IDE_CSP0_8_RESET
-       REG_SHADOW_SET(port_csp0_addr, port_csp0_shadow, 8, val);
-#endif
 #ifdef CONFIG_ETRAX_IDE_PB7_RESET
        port_pb_dir_shadow = port_pb_dir_shadow |
                IO_STATE(R_PORT_PB_DIR, dir7, output);
@@ -732,7 +724,7 @@ static int speed_cris_ide(ide_drive_t *drive, u8 speed)
 
        if (speed >= XFER_PIO_0 && speed <= XFER_PIO_4) {
                tune_cris_ide(drive, speed - XFER_PIO_0);
-               return 0;
+               return ide_config_drive_speed(drive, speed);
        }
 
        switch(speed)
@@ -762,7 +754,8 @@ static int speed_cris_ide(ide_drive_t *drive, u8 speed)
                        hold = ATA_DMA2_HOLD;
                        break;
                default:
-                       return 0;
+                       BUG();
+                       break;
        }
 
        if (speed >= XFER_UDMA_0)
@@ -770,7 +763,7 @@ static int speed_cris_ide(ide_drive_t *drive, u8 speed)
        else
                cris_ide_set_speed(TYPE_DMA, 0, strobe, hold);
 
-       return 0;
+       return ide_config_drive_speed(drive, speed);
 }
 
 void __init
@@ -797,7 +790,7 @@ init_e100_ide (void)
                                ide_offsets,
                                0, 0, cris_ide_ack_intr,
                                ide_default_irq(0));
-               ide_register_hw(&hw, &hwif);
+               ide_register_hw(&hw, 1, &hwif);
                hwif->mmio = 1;
                hwif->chipset = ide_etrax100;
                hwif->tuneproc = &tune_cris_ide;
@@ -820,10 +813,9 @@ init_e100_ide (void)
                hwif->dma_host_off = &cris_dma_off;
                hwif->dma_host_on = &cris_dma_on;
                hwif->dma_off_quietly = &cris_dma_off;
-               hwif->udma_four = 0;
+               hwif->cbl = ATA_CBL_PATA40;
                hwif->ultra_mask = cris_ultra_mask;
                hwif->mwdma_mask = 0x07; /* Multiword DMA 0-2 */
-               hwif->swdma_mask = 0x07; /* Singleword DMA 0-2 */
                hwif->autodma = 1;
                hwif->drives[0].autodma = 1;
                hwif->drives[1].autodma = 1;
@@ -1004,19 +996,6 @@ static int cris_ide_build_dmatable (ide_drive_t *drive)
        return 1;       /* let the PIO routines handle this weirdness */
 }
 
-static int cris_config_drive_for_dma (ide_drive_t *drive)
-{
-       u8 speed = ide_dma_speed(drive, 1);
-
-       if (!speed)
-               return 0;
-
-       speed_cris_ide(drive, speed);
-       ide_config_drive_speed(drive, speed);
-
-       return ide_dma_enable(drive);
-}
-
 /*
  * cris_dma_intr() is the handler for disk read/write DMA interrupts
  */
@@ -1046,7 +1025,7 @@ static ide_startstop_t cris_dma_intr (ide_drive_t *drive)
 
 static int cris_dma_check(ide_drive_t *drive)
 {
-       if (ide_use_dma(drive) && cris_config_drive_for_dma(drive))
+       if (ide_tune_dma(drive))
                return 0;
 
        return -1;