Commit ab462768 authored by Alan Cox's avatar Alan Cox Committed by Paul Mackerras

[POWERPC] pci_32.c: Switch to ref counting PCI API

pci_find_slot isn't hot-plug safe.  Move this code to the pci hotplug
safe equivalent and hold a refcount properly while doing
make_one_node_map.
Signed-off-by: default avatarAlan Cox <alan@redhat.com>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent 37f01d64
...@@ -656,10 +656,13 @@ make_one_node_map(struct device_node* node, u8 pci_bus) ...@@ -656,10 +656,13 @@ make_one_node_map(struct device_node* node, u8 pci_bus)
reg = of_get_property(node, "reg", NULL); reg = of_get_property(node, "reg", NULL);
if (!reg) if (!reg)
continue; continue;
dev = pci_find_slot(pci_bus, ((reg[0] >> 8) & 0xff)); dev = pci_get_bus_and_slot(pci_bus, ((reg[0] >> 8) & 0xff));
if (!dev || !dev->subordinate) if (!dev || !dev->subordinate) {
pci_dev_put(dev);
continue; continue;
}
make_one_node_map(node, dev->subordinate->number); make_one_node_map(node, dev->subordinate->number);
pci_dev_put(dev);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment