aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjorn Helgaas <bhelgaas@google.com>2011-10-28 18:25:55 -0400
committerJesse Barnes <jbarnes@virtuousgeek.org>2012-01-06 15:10:53 -0500
commitde4b2f76d69673cea08be952dcb4df2f4c81c6e3 (patch)
treec4ad7b48299c2916117367641dfe1fa09325d8e1
parenta2ebb827958a4ab3577443f89037f229683c644a (diff)
PCI: convert pci_scan_bus() to use pci_create_root_bus()
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. v2: export pci_scan_bus Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
-rw-r--r--drivers/pci/probe.c19
-rw-r--r--include/linux/pci.h10
2 files changed, 20 insertions, 9 deletions
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index 7fc7e14118cc..d09644b52d1c 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -1649,6 +1649,25 @@ struct pci_bus * __devinit pci_scan_bus_parented(struct device *parent,
1649} 1649}
1650EXPORT_SYMBOL(pci_scan_bus_parented); 1650EXPORT_SYMBOL(pci_scan_bus_parented);
1651 1651
1652struct pci_bus * __devinit pci_scan_bus(int bus, struct pci_ops *ops,
1653 void *sysdata)
1654{
1655 LIST_HEAD(resources);
1656 struct pci_bus *b;
1657
1658 pci_add_resource(&resources, &ioport_resource);
1659 pci_add_resource(&resources, &iomem_resource);
1660 b = pci_create_root_bus(NULL, bus, ops, sysdata, &resources);
1661 if (b) {
1662 b->subordinate = pci_scan_child_bus(b);
1663 pci_bus_add_devices(b);
1664 } else {
1665 pci_free_resource_list(&resources);
1666 }
1667 return b;
1668}
1669EXPORT_SYMBOL(pci_scan_bus);
1670
1652#ifdef CONFIG_HOTPLUG 1671#ifdef CONFIG_HOTPLUG
1653/** 1672/**
1654 * pci_rescan_bus - scan a PCI bus for devices. 1673 * pci_rescan_bus - scan a PCI bus for devices.
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 5102d74f6bfc..ff280e08690f 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -661,15 +661,7 @@ extern struct pci_bus *pci_find_bus(int domain, int busnr);
661void pci_bus_add_devices(const struct pci_bus *bus); 661void pci_bus_add_devices(const struct pci_bus *bus);
662struct pci_bus *pci_scan_bus_parented(struct device *parent, int bus, 662struct pci_bus *pci_scan_bus_parented(struct device *parent, int bus,
663 struct pci_ops *ops, void *sysdata); 663 struct pci_ops *ops, void *sysdata);
664static inline struct pci_bus * __devinit pci_scan_bus(int bus, struct pci_ops *ops, 664struct pci_bus *pci_scan_bus(int bus, struct pci_ops *ops, void *sysdata);
665 void *sysdata)
666{
667 struct pci_bus *root_bus;
668 root_bus = pci_scan_bus_parented(NULL, bus, ops, sysdata);
669 if (root_bus)
670 pci_bus_add_devices(root_bus);
671 return root_bus;
672}
673struct pci_bus *pci_create_root_bus(struct device *parent, int bus, 665struct pci_bus *pci_create_root_bus(struct device *parent, int bus,
674 struct pci_ops *ops, void *sysdata, 666 struct pci_ops *ops, void *sysdata,
675 struct list_head *resources); 667 struct list_head *resources);