]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
PCI: convert pci_scan_bus_parented() to use pci_create_root_bus()
authorBjorn Helgaas <bhelgaas@google.com>
Fri, 28 Oct 2011 22:26:00 +0000 (16:26 -0600)
committerJesse Barnes <jbarnes@virtuousgeek.org>
Tue, 13 Dec 2011 18:42:13 +0000 (10:42 -0800)
This converts pci_scan_bus_parented() to use pci_create_root_bus()
instead of pci_create_bus().  The new bus still has the default (incorrect)
resources, so this patch doesn't help fix that problem, but it does remove
one more use of pci_create_bus().

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
drivers/pci/probe.c

index 0cd2444bfd055a10872b3ded203882eed771e4c6..5fda6ac5974ddf6bfff8741bf1c38747670bffef 100644 (file)
@@ -1640,11 +1640,16 @@ struct pci_bus *pci_create_bus(struct device *parent,
 struct pci_bus * __devinit pci_scan_bus_parented(struct device *parent,
                int bus, struct pci_ops *ops, void *sysdata)
 {
+       LIST_HEAD(resources);
        struct pci_bus *b;
 
-       b = pci_create_bus(parent, bus, ops, sysdata);
+       pci_add_resource(&resources, &ioport_resource);
+       pci_add_resource(&resources, &iomem_resource);
+       b = pci_create_root_bus(parent, bus, ops, sysdata, &resources);
        if (b)
                b->subordinate = pci_scan_child_bus(b);
+       else
+               pci_free_resource_list(&resources);
        return b;
 }
 EXPORT_SYMBOL(pci_scan_bus_parented);