]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/alpha/kernel/sys_miata.c
drivers/net/skfp/ess.c: fix compile warnings
[linux-2.6-omap-h63xx.git] / arch / alpha / kernel / sys_miata.c
index b8b817feb1eedb8db7be5baa8df5639cb02a4b0f..910b43cd63e830b7f1a8664b3a4833b1a81e2e8e 100644 (file)
@@ -183,11 +183,15 @@ miata_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
 
        if((slot == 7) && (PCI_FUNC(dev->devfn) == 3)) {
                u8 irq=0;
-
-               if(pci_read_config_byte(pci_find_slot(dev->bus->number, dev->devfn & ~(7)), 0x40,&irq)!=PCIBIOS_SUCCESSFUL)
+               struct pci_dev *pdev = pci_get_slot(dev->bus, dev->devfn & ~7);
+               if(pdev == NULL || pci_read_config_byte(pdev, 0x40,&irq) != PCIBIOS_SUCCESSFUL) {
+                       pci_dev_put(pdev);
                        return -1;
-               else    
+               }
+               else    {
+                       pci_dev_put(pdev);
                        return irq;
+               }
        }
 
        return COMMON_TABLE_LOOKUP;