[PATCH] PIIX/SLC90E66: PIO mode fallback fix
[pandora-kernel.git] / drivers / ide / pci / cy82c693.c
index 5a33513..64330c4 100644 (file)
@@ -44,7 +44,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/pci.h>
@@ -282,7 +281,7 @@ static void cy82c693_tune_drive (ide_drive_t *drive, u8 pio)
 
        /* select primary or secondary channel */
        if (hwif->index > 0) {  /* drive is on the secondary channel */
-               dev = pci_find_slot(dev->bus->number, dev->devfn+1);
+               dev = pci_get_slot(dev->bus, dev->devfn+1);
                if (!dev) {
                        printk(KERN_ERR "%s: tune_drive: "
                                "Cannot find secondary interface!\n",
@@ -469,7 +468,7 @@ static void __devinit init_hwif_cy82c693(ide_hwif_t *hwif)
 
 static __devinitdata ide_hwif_t *primary;
 
-void __devinit init_iops_cy82c693(ide_hwif_t *hwif)
+static void __devinit init_iops_cy82c693(ide_hwif_t *hwif)
 {
        if (PCI_FUNC(hwif->pci_dev->devfn) == 1)
                primary = hwif;
@@ -501,8 +500,9 @@ static int __devinit cy82c693_init_one(struct pci_dev *dev, const struct pci_dev
           Function 1 is primary IDE channel, function 2 - secondary. */
         if ((dev->class >> 8) == PCI_CLASS_STORAGE_IDE &&
            PCI_FUNC(dev->devfn) == 1) {
-               dev2 = pci_find_slot(dev->bus->number, dev->devfn + 1);
+               dev2 = pci_get_slot(dev->bus, dev->devfn + 1);
                ret = ide_setup_pci_devices(dev, dev2, d);
+               /* We leak pci refs here but thats ok - we can't be unloaded */
        }
        return ret;
 }