[POWERPC] pci_32.c: Switch to ref counting PCI API
authorAlan Cox <alan@lxorguk.ukuu.org.uk>
Mon, 23 Apr 2007 13:47:59 +0000 (14:47 +0100)
committerPaul Mackerras <paulus@samba.org>
Tue, 24 Apr 2007 12:12:20 +0000 (22:12 +1000)
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: Alan Cox <alan@redhat.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
arch/powerpc/kernel/pci_32.c

index 5b05a09a6bdf5d43d26537a73d50c04792157e9b..f022862de34458b90a402a6c20330819aec7ff09 100644 (file)
@@ -656,10 +656,13 @@ make_one_node_map(struct device_node* node, u8 pci_bus)
                reg = of_get_property(node, "reg", NULL);
                if (!reg)
                        continue;
-               dev = pci_find_slot(pci_bus, ((reg[0] >> 8) & 0xff));
-               if (!dev || !dev->subordinate)
+               dev = pci_get_bus_and_slot(pci_bus, ((reg[0] >> 8) & 0xff));
+               if (!dev || !dev->subordinate) {
+                       pci_dev_put(dev);
                        continue;
+               }
                make_one_node_map(node, dev->subordinate->number);
+               pci_dev_put(dev);
        }
 }