sl82c105: Switch to ref counting API
authorAlan Cox <alan@lxorguk.ukuu.org.uk>
Tue, 15 May 2007 22:51:46 +0000 (00:51 +0200)
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Tue, 15 May 2007 22:51:46 +0000 (00:51 +0200)
Not sure how this one got missed in the great purge some time ago but it did.

Signed-off-by: Alan Cox <alan@redhat.com>
Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
drivers/ide/pci/sl82c105.c

index ac1ec17..7c383d9 100644 (file)
@@ -349,7 +349,7 @@ static unsigned int sl82c105_bridge_revision(struct pci_dev *dev)
        /*
         * The bridge should be part of the same device, but function 0.
         */
-       bridge = pci_find_slot(dev->bus->number,
+       bridge = pci_get_bus_and_slot(dev->bus->number,
                               PCI_DEVFN(PCI_SLOT(dev->devfn), 0));
        if (!bridge)
                return -1;
@@ -359,13 +359,15 @@ static unsigned int sl82c105_bridge_revision(struct pci_dev *dev)
         */
        if (bridge->vendor != PCI_VENDOR_ID_WINBOND ||
            bridge->device != PCI_DEVICE_ID_WINBOND_83C553 ||
-           bridge->class >> 8 != PCI_CLASS_BRIDGE_ISA)
+           bridge->class >> 8 != PCI_CLASS_BRIDGE_ISA) {
+               pci_dev_put(bridge);
                return -1;
-
+       }
        /*
         * We need to find function 0's revision, not function 1
         */
        pci_read_config_byte(bridge, PCI_REVISION_ID, &rev);
+       pci_dev_put(bridge);
 
        return rev;
 }