]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/ide/setup-pci.c
hpt366: MWDMA filter for SATA cards (take 2)
[linux-2.6-omap-h63xx.git] / drivers / ide / setup-pci.c
index e9f3267456e2925f5cf9e7ebf34fda1aee411382..1129f8c30840f00280320bb29a489a52aa7e3ac2 100644 (file)
@@ -5,12 +5,6 @@
  *
  *  Copyright (c) 1995-1998  Mark Lord
  *  May be copied or modified under the terms of the GNU General Public License
- *
- *  Recent Changes
- *     Split the set up function into multiple functions
- *     Use pci_set_master
- *     Fix misreporting of I/O v MMIO problems
- *     Initial fixups for simplex devices
  */
 
 /*
@@ -614,6 +608,7 @@ void ide_pci_setup_ports(struct pci_dev *dev, ide_pci_device_t *d, int pciirq, a
                        ide_hwif_setup_dma(dev, d, hwif);
 bypass_legacy_dma:
                hwif->host_flags = d->host_flags;
+               hwif->pio_mask = d->pio_mask;
 
                if (d->init_hwif)
                        /* Call chipset-specific routine
@@ -821,19 +816,15 @@ static int __init ide_scan_pcidev(struct pci_dev *dev)
        struct list_head *l;
        struct pci_driver *d;
        
-       list_for_each(l, &ide_pci_drivers)
-       {
+       list_for_each(l, &ide_pci_drivers) {
                d = list_entry(l, struct pci_driver, node);
-               if(d->id_table)
-               {
-                       const struct pci_device_id *id = pci_match_id(d->id_table, dev);
-                       if(id != NULL)
-                       {
-                               if(d->probe(dev, id) >= 0)
-                               {
-                                       dev->driver = d;
-                                       return 1;
-                               }
+               if (d->id_table) {
+                       const struct pci_device_id *id = pci_match_id(d->id_table,
+                                                                     dev);
+                       if (id != NULL && d->probe(dev, id) >= 0) {
+                               dev->driver = d;
+                               pci_dev_get(dev);
+                               return 1;
                        }
                }
        }
@@ -856,15 +847,13 @@ void __init ide_scan_pcibus (int scan_direction)
        struct list_head *l, *n;
 
        pre_init = 0;
-       if (!scan_direction) {
-               while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) {
+       if (!scan_direction)
+               while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL)
                        ide_scan_pcidev(dev);
-               }
-       } else {
-               while ((dev = pci_get_device_reverse(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) {
+       else
+               while ((dev = pci_get_device_reverse(PCI_ANY_ID, PCI_ANY_ID, dev))
+                      != NULL)
                        ide_scan_pcidev(dev);
-               }
-       }
        
        /*
         *      Hand the drivers over to the PCI layer now we
@@ -874,12 +863,9 @@ void __init ide_scan_pcibus (int scan_direction)
        list_for_each_safe(l, n, &ide_pci_drivers) {
                list_del(l);
                d = list_entry(l, struct pci_driver, node);
-               if (__pci_register_driver(d, d->driver.owner,
-                                       d->driver.mod_name)) {
-                       printk(KERN_ERR "%s: failed to register driver "
-                                       "for %s\n", __FUNCTION__,
-                                        d->driver.mod_name);
-               }
+               if (__pci_register_driver(d, d->driver.owner, d->driver.mod_name))
+                       printk(KERN_ERR "%s: failed to register driver for %s\n",
+                              __FUNCTION__, d->driver.mod_name);
        }
 }
 #endif