Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ericvh...
[pandora-kernel.git] / drivers / ide / pci / aec62xx.c
index a7c725f..990eafe 100644 (file)
@@ -94,9 +94,9 @@ static u8 aec62xx_ratemask (ide_drive_t *drive)
        switch(hwif->pci_dev->device) {
                case PCI_DEVICE_ID_ARTOP_ATP865:
                case PCI_DEVICE_ID_ARTOP_ATP865R:
-                       mode = (hwif->INB(((hwif->channel) ?
-                                       hwif->mate->dma_status :
-                                       hwif->dma_status)) & 0x10) ? 4 : 3;
+                       mode = (inb(hwif->channel ?
+                                   hwif->mate->dma_status :
+                                   hwif->dma_status) & 0x10) ? 4 : 3;
                        break;
                case PCI_DEVICE_ID_ARTOP_ATP860:
                case PCI_DEVICE_ID_ARTOP_ATP860R:
@@ -209,25 +209,13 @@ static void aec62xx_tune_drive (ide_drive_t *drive, u8 pio)
 
 static int aec62xx_config_drive_xfer_rate (ide_drive_t *drive)
 {
-       ide_hwif_t *hwif        = HWIF(drive);
-       struct hd_driveid *id   = drive->id;
-
-       if ((id->capability & 1) && drive->autodma) {
-
-               if (ide_use_dma(drive)) {
-                       if (config_chipset_for_dma(drive))
-                               return hwif->ide_dma_on(drive);
-               }
-
-               goto fast_ata_pio;
+       if (ide_use_dma(drive) && config_chipset_for_dma(drive))
+               return 0;
 
-       } else if ((id->capability & 8) || (id->field_valid & 2)) {
-fast_ata_pio:
+       if (ide_use_fast_pio(drive))
                aec62xx_tune_drive(drive, 5);
-               return hwif->ide_dma_off_quietly(drive);
-       }
-       /* IORDY not supported */
-       return 0;
+
+       return -1;
 }
 
 static int aec62xx_irq_timeout (ide_drive_t *drive)
@@ -286,10 +274,8 @@ static void __devinit init_hwif_aec62xx(ide_hwif_t *hwif)
        hwif->tuneproc = &aec62xx_tune_drive;
        hwif->speedproc = &aec62xx_tune_chipset;
 
-       if (hwif->pci_dev->device == PCI_DEVICE_ID_ARTOP_ATP850UF) {
+       if (hwif->pci_dev->device == PCI_DEVICE_ID_ARTOP_ATP850UF)
                hwif->serialized = hwif->channel;
-               hwif->no_dsc = 1;
-       }
 
        if (hwif->mate)
                hwif->mate->serialized = hwif->serialized;
@@ -425,12 +411,12 @@ static int __devinit aec62xx_init_one(struct pci_dev *dev, const struct pci_devi
        return d->init_setup(dev, d);
 }
 
-static const struct pci_device_id aec62xx_pci_tbl[] = {
-       { PCI_DEVICE(PCI_VENDOR_ID_ARTOP, PCI_DEVICE_ID_ARTOP_ATP850UF), 0 },
-       { PCI_DEVICE(PCI_VENDOR_ID_ARTOP, PCI_DEVICE_ID_ARTOP_ATP860), 1 },
-       { PCI_DEVICE(PCI_VENDOR_ID_ARTOP, PCI_DEVICE_ID_ARTOP_ATP860R), 2 },
-       { PCI_DEVICE(PCI_VENDOR_ID_ARTOP, PCI_DEVICE_ID_ARTOP_ATP865), 3 },
-       { PCI_DEVICE(PCI_VENDOR_ID_ARTOP, PCI_DEVICE_ID_ARTOP_ATP865R), 4 },
+static struct pci_device_id aec62xx_pci_tbl[] = {
+       { PCI_VENDOR_ID_ARTOP, PCI_DEVICE_ID_ARTOP_ATP850UF, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
+       { PCI_VENDOR_ID_ARTOP, PCI_DEVICE_ID_ARTOP_ATP860,   PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1 },
+       { PCI_VENDOR_ID_ARTOP, PCI_DEVICE_ID_ARTOP_ATP860R,  PCI_ANY_ID, PCI_ANY_ID, 0, 0, 2 },
+       { PCI_VENDOR_ID_ARTOP, PCI_DEVICE_ID_ARTOP_ATP865,   PCI_ANY_ID, PCI_ANY_ID, 0, 0, 3 },
+       { PCI_VENDOR_ID_ARTOP, PCI_DEVICE_ID_ARTOP_ATP865R,  PCI_ANY_ID, PCI_ANY_ID, 0, 0, 4 },
        { 0, },
 };
 MODULE_DEVICE_TABLE(pci, aec62xx_pci_tbl);
@@ -441,7 +427,7 @@ static struct pci_driver driver = {
        .probe          = aec62xx_init_one,
 };
 
-static int aec62xx_ide_init(void)
+static int __init aec62xx_ide_init(void)
 {
        return ide_pci_register_driver(&driver);
 }