PCI: Hold pci_slot_mutex while searching bus->slots list
[deliverable/linux.git] / arch / sparc / kernel / pci.c
index c928bc64b4bac1b1c5eb88c71c348469796883c5..3a0e1a986bfe3cf89c9f3cb92ac04c056b0f86eb 100644 (file)
@@ -249,7 +249,6 @@ static struct pci_dev *of_create_pci_dev(struct pci_pbm_info *pbm,
                                         struct pci_bus *bus, int devfn)
 {
        struct dev_archdata *sd;
-       struct pci_slot *slot;
        struct platform_device *op;
        struct pci_dev *dev;
        const char *type;
@@ -290,10 +289,7 @@ static struct pci_dev *of_create_pci_dev(struct pci_pbm_info *pbm,
        dev->multifunction = 0;         /* maybe a lie? */
        set_pcie_port_type(dev);
 
-       list_for_each_entry(slot, &dev->bus->slots, list)
-               if (PCI_SLOT(dev->devfn) == slot->number)
-                       dev->slot = slot;
-
+       pci_dev_assign_slot(dev);
        dev->vendor = of_getintprop_default(node, "vendor-id", 0xffff);
        dev->device = of_getintprop_default(node, "device-id", 0xffff);
        dev->subsystem_vendor =
This page took 0.026049 seconds and 5 git commands to generate.