fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git] / drivers / ide / setup-pci.c
index 7ebf992..695e239 100644 (file)
@@ -18,7 +18,6 @@
  *  configuration of all PCI IDE interfaces present in a system.  
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
@@ -102,7 +101,7 @@ static ide_hwif_t *ide_match_hwif(unsigned long io_base, u8 bootable, const char
                                return hwif;    /* pick an unused entry */
                }
        }
-       for (h = 0; h < 2; ++h) {
+       for (h = 0; h < 2 && h < MAX_HWIFS; ++h) {
                hwif = ide_hwifs + h;
                if (hwif->chipset == ide_unknown)
                        return hwif;    /* pick an unused entry */
@@ -580,7 +579,6 @@ void ide_pci_setup_ports(struct pci_dev *dev, ide_pci_device_t *d, int pciirq, a
        int port;
        int at_least_one_hwif_enabled = 0;
        ide_hwif_t *hwif, *mate = NULL;
-       static int secondpdc = 0;
        u8 tmp;
 
        index->all = 0xf0f0;
@@ -592,21 +590,9 @@ void ide_pci_setup_ports(struct pci_dev *dev, ide_pci_device_t *d, int pciirq, a
        for (port = 0; port <= 1; ++port) {
                ide_pci_enablebit_t *e = &(d->enablebits[port]);
        
-               /* 
-                * If this is a Promise FakeRaid controller,
-                * the 2nd controller will be marked as 
-                * disabled while it is actually there and enabled
-                * by the bios for raid purposes. 
-                * Skip the normal "is it enabled" test for those.
-                */
-               if ((d->flags & IDEPCI_FLAG_FORCE_PDC) &&
-                   (secondpdc++==1) && (port==1))
-                       goto controller_ok;
-                       
                if (e->reg && (pci_read_config_byte(dev, e->reg, &tmp) ||
                    (tmp & e->mask) != e->val))
                        continue;       /* port not enabled */
-controller_ok:
 
                if (d->channels <= port)
                        break;
@@ -707,13 +693,8 @@ static int do_ide_setup_pci_device(struct pci_dev *dev, ide_pci_device_t *d,
                                goto out;
                }
                if (noisy)
-#ifdef __sparc__
-                       printk(KERN_INFO "%s: 100%% native mode on irq %s\n",
-                              d->name, __irq_itoa(pciirq));
-#else
                        printk(KERN_INFO "%s: 100%% native mode on irq %d\n",
                                d->name, pciirq);
-#endif
        }
 
        /* FIXME: silent failure can happen */
@@ -813,24 +794,6 @@ int __ide_pci_register_driver(struct pci_driver *driver, struct module *module)
 
 EXPORT_SYMBOL_GPL(__ide_pci_register_driver);
 
-/**
- *     ide_unregister_pci_driver       -       unregister an IDE driver
- *     @driver: driver to remove
- *
- *     Unregister a currently installed IDE driver. Returns are the same
- *     as for pci_unregister_driver
- */
-void ide_pci_unregister_driver(struct pci_driver *driver)
-{
-       if(!pre_init)
-               pci_unregister_driver(driver);
-       else
-               list_del(&driver->node);
-}
-
-EXPORT_SYMBOL_GPL(ide_pci_unregister_driver);
-
 /**
  *     ide_scan_pcidev         -       find an IDE driver for a device
  *     @dev: PCI device to check
@@ -881,11 +844,11 @@ void __init ide_scan_pcibus (int scan_direction)
 
        pre_init = 0;
        if (!scan_direction) {
-               while ((dev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) {
+               while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) {
                        ide_scan_pcidev(dev);
                }
        } else {
-               while ((dev = pci_find_device_reverse(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) {
+               while ((dev = pci_get_device_reverse(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) {
                        ide_scan_pcidev(dev);
                }
        }