]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/ide/pci/jmicron.c
Merge branch 'for-linus' of master.kernel.org:/pub/scm/linux/kernel/git/dtor/input
[linux-2.6-omap-h63xx.git] / drivers / ide / pci / jmicron.c
index 35dda8fcd0ac0462880da741d682a2d5d68dffb6..53f25500c22b57afdb2cc54f1daa2cd510070000 100644 (file)
@@ -86,8 +86,8 @@ static int __devinit ata66_jmicron(ide_hwif_t *hwif)
        {
        case PORT_PATA0:
                if (control & (1 << 3)) /* 40/80 pin primary */
-                       return 1;
-               return 0;
+                       return 0;
+               return 1;
        case PORT_PATA1:
                if (control5 & (1 << 19))       /* 40/80 pin secondary */
                        return 0;
@@ -147,7 +147,9 @@ static int config_chipset_for_dma (ide_drive_t *drive)
 {
        u8 speed        = ide_dma_speed(drive, jmicron_ratemask(drive));
 
-       config_jmicron_chipset_for_pio(drive, !speed);
+       if (!speed)
+               return 0;
+
        jmicron_tune_chipset(drive, speed);
        return ide_dma_enable(drive);
 }
@@ -162,14 +164,12 @@ static int config_chipset_for_dma (ide_drive_t *drive)
 
 static int jmicron_config_drive_for_dma (ide_drive_t *drive)
 {
-       ide_hwif_t *hwif        = drive->hwif;
+       if (ide_use_dma(drive) && config_chipset_for_dma(drive))
+               return 0;
 
-       if (ide_use_dma(drive)) {
-               if (config_chipset_for_dma(drive))
-                       return hwif->ide_dma_on(drive);
-       }
        config_jmicron_chipset_for_pio(drive, 1);
-       return hwif->ide_dma_off_quietly(drive);
+
+       return -1;
 }
 
 /**
@@ -241,11 +241,11 @@ static int __devinit jmicron_init_one(struct pci_dev *dev, const struct pci_devi
 }
 
 static struct pci_device_id jmicron_pci_tbl[] = {
-       { PCI_DEVICE(PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB361), 0},
-       { PCI_DEVICE(PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB363), 1},
-       { PCI_DEVICE(PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB365), 2},
-       { PCI_DEVICE(PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB366), 3},
-       { PCI_DEVICE(PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB368), 4},
+       { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB361, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
+       { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB363, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1},
+       { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB365, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 2},
+       { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB366, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 3},
+       { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB368, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 4},
        { 0, },
 };