]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
PCI: convert pci_scan_bus() to use pci_create_root_bus()
authorBjorn Helgaas <bhelgaas@google.com>
Fri, 28 Oct 2011 22:25:55 +0000 (16:25 -0600)
committerJesse Barnes <jbarnes@virtuousgeek.org>
Tue, 13 Dec 2011 18:42:12 +0000 (10:42 -0800)
I plan to deprecate pci_scan_bus_parented(), so use pci_create_root_bus()
directly instead.  pci_scan_bus() itself will be removed as soon as all
callers are gone, so this is just an interim step.

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

index 7fc7e14118cc2a7e9f1a2fab9568974010afe864..0cd2444bfd055a10872b3ded203882eed771e4c6 100644 (file)
@@ -1649,6 +1649,24 @@ struct pci_bus * __devinit pci_scan_bus_parented(struct device *parent,
 }
 EXPORT_SYMBOL(pci_scan_bus_parented);
 
+struct pci_bus * __devinit pci_scan_bus(int bus, struct pci_ops *ops,
+                                       void *sysdata)
+{
+       LIST_HEAD(resources);
+       struct pci_bus *b;
+
+       pci_add_resource(&resources, &ioport_resource);
+       pci_add_resource(&resources, &iomem_resource);
+       b = pci_create_root_bus(NULL, bus, ops, sysdata, &resources);
+       if (b) {
+               b->subordinate = pci_scan_child_bus(b);
+               pci_bus_add_devices(b);
+       } else {
+               pci_free_resource_list(&resources);
+       }
+       return b;
+}
+
 #ifdef CONFIG_HOTPLUG
 /**
  * pci_rescan_bus - scan a PCI bus for devices.
index 5102d74f6bfcd445766ca2443f5aca37b079d84a..ff280e08690f6374ce0de1a748f41ba9707c073b 100644 (file)
@@ -661,15 +661,7 @@ extern struct pci_bus *pci_find_bus(int domain, int busnr);
 void pci_bus_add_devices(const struct pci_bus *bus);
 struct pci_bus *pci_scan_bus_parented(struct device *parent, int bus,
                                      struct pci_ops *ops, void *sysdata);
-static inline struct pci_bus * __devinit pci_scan_bus(int bus, struct pci_ops *ops,
-                                          void *sysdata)
-{
-       struct pci_bus *root_bus;
-       root_bus = pci_scan_bus_parented(NULL, bus, ops, sysdata);
-       if (root_bus)
-               pci_bus_add_devices(root_bus);
-       return root_bus;
-}
+struct pci_bus *pci_scan_bus(int bus, struct pci_ops *ops, void *sysdata);
 struct pci_bus *pci_create_root_bus(struct device *parent, int bus,
                                    struct pci_ops *ops, void *sysdata,
                                    struct list_head *resources);