]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/pci/probe.c
PCI: connect struct pci_dev to struct pci_slot
[linux-2.6-omap-h63xx.git] / drivers / pci / probe.c
index 578d15f49e023eb0acc215e1ab5d5fa93aaf5872..7aa71636dd3c3d7534a1e0fd47156a8e1a6a7ee4 100644 (file)
@@ -949,6 +949,7 @@ EXPORT_SYMBOL(alloc_pci_dev);
 static struct pci_dev *pci_scan_device(struct pci_bus *bus, int devfn)
 {
        struct pci_dev *dev;
+       struct pci_slot *slot;
        u32 l;
        u8 hdr_type;
        int delay = 1;
@@ -997,6 +998,10 @@ static struct pci_dev *pci_scan_device(struct pci_bus *bus, int devfn)
        dev->error_state = pci_channel_io_normal;
        set_pcie_port_type(dev);
 
+       list_for_each_entry(slot, &bus->slots, list)
+               if (PCI_SLOT(devfn) == slot->number)
+                       dev->slot = slot;
+
        /* Assume 32-bit PCI; let 64-bit PCI cards (which are far rarer)
           set this higher, assuming the system even supports it.  */
        dev->dma_mask = 0xffffffff;