ide: remove SATA_*_REG macros
[powerpc.git] / drivers / ide / pci / amd74xx.c
index 2e8cbca..2ef890c 100644 (file)
@@ -1,6 +1,4 @@
 /*
- * Version 2.25
- *
  * AMD 755/756/766/8111 and nVidia nForce/2/2s/3/3s/CK804/MCP04
  * IDE driver for Linux.
  *
 
 #include <linux/module.h>
 #include <linux/kernel.h>
-#include <linux/ioport.h>
-#include <linux/blkdev.h>
 #include <linux/pci.h>
 #include <linux/init.h>
 #include <linux/ide.h>
-#include <asm/io.h>
 
 #include "ide-timing.h"
 
@@ -86,6 +81,7 @@ static void amd_set_speed(struct pci_dev *dev, u8 dn, u8 udma_mask,
 static void amd_set_drive(ide_drive_t *drive, const u8 speed)
 {
        ide_hwif_t *hwif = drive->hwif;
+       struct pci_dev *dev = to_pci_dev(hwif->dev);
        ide_drive_t *peer = hwif->drives + (~drive->dn & 1);
        struct ide_timing t, p;
        int T, UT;
@@ -104,7 +100,7 @@ static void amd_set_drive(ide_drive_t *drive, const u8 speed)
        if (speed == XFER_UDMA_5 && amd_clock <= 33333) t.udma = 1;
        if (speed == XFER_UDMA_6 && amd_clock <= 33333) t.udma = 15;
 
-       amd_set_speed(hwif->pci_dev, drive->dn, udma_mask, &t);
+       amd_set_speed(dev, drive->dn, udma_mask, &t);
 }
 
 /*
@@ -200,23 +196,25 @@ static unsigned int __devinit init_chipset_amd74xx(struct pci_dev *dev,
        return dev->irq;
 }
 
+static u8 __devinit amd_cable_detect(ide_hwif_t *hwif)
+{
+       if ((amd_80w >> hwif->channel) & 1)
+               return ATA_CBL_PATA80;
+       else
+               return ATA_CBL_PATA40;
+}
+
 static void __devinit init_hwif_amd74xx(ide_hwif_t *hwif)
 {
+       struct pci_dev *dev = to_pci_dev(hwif->dev);
+
        if (hwif->irq == 0) /* 0 is bogus but will do for now */
-               hwif->irq = pci_get_legacy_ide_irq(hwif->pci_dev, hwif->channel);
+               hwif->irq = pci_get_legacy_ide_irq(dev, hwif->channel);
 
        hwif->set_pio_mode = &amd_set_pio_mode;
        hwif->set_dma_mode = &amd_set_drive;
 
-       if (!hwif->dma_base)
-               return;
-
-       if (hwif->cbl != ATA_CBL_PATA40_SHORT) {
-               if ((amd_80w >> hwif->channel) & 1)
-                       hwif->cbl = ATA_CBL_PATA80;
-               else
-                       hwif->cbl = ATA_CBL_PATA40;
-       }
+       hwif->cable_detect = amd_cable_detect;
 }
 
 #define IDE_HFLAGS_AMD \