@@ -420,6 +420,18 @@ probe_pci_root_info(struct pci_root_info *info, struct acpi_device *device,
return 0;
}
+static int pci_host_bridge_prepare(struct pci_host_bridge *bridge)
+{
+ struct pci_sysdata *sd = dev_get_drvdata(&bridge->dev);
+
+ ACPI_COMPANION_SET(&bridge->dev, sd->companion);
+ return 0;
+}
+
+static struct pci_host_bridge_ops phb_ops = {
+ .phb_prepare = pci_host_bridge_prepare,
+};
+
struct pci_bus *pci_acpi_scan_root(struct acpi_pci_root *root)
{
struct acpi_device *device = root->device;
@@ -428,7 +440,7 @@ struct pci_bus *pci_acpi_scan_root(struct acpi_pci_root *root)
struct pci_controller *controller;
struct pci_root_info *info = NULL;
int busnum = root->secondary.start;
- struct pci_bus *pbus;
+ struct pci_host_bridge *host;
int ret;
controller = alloc_pci_controller(domain);
@@ -465,26 +477,16 @@ struct pci_bus *pci_acpi_scan_root(struct acpi_pci_root *root)
* should handle the case here, but it appears that IA64 hasn't
* such quirk. So we just ignore the case now.
*/
- pbus = pci_create_root_bus(NULL, PCI_DOMBUS(domain, bus),
- &pci_root_ops, controller, &info->resources);
- if (!pbus) {
+ host = pci_scan_root_bridge(NULL, PCI_DOMBUS(domain, bus),
+ &pci_root_ops, controller, &info->resources, &phb_ops);
+ if (!host) {
pci_free_resource_list(&info->resources);
__release_pci_root_info(info);
return NULL;
}
- pci_set_host_bridge_release(to_pci_host_bridge(pbus->bridge),
- release_pci_root_info, info);
- pci_scan_child_bus(pbus);
- return pbus;
-}
-
-int pcibios_root_bridge_prepare(struct pci_host_bridge *bridge)
-{
- struct pci_controller *controller = bridge->bus->sysdata;
-
- ACPI_COMPANION_SET(&bridge->dev, controller->companion);
- return 0;
+ pci_set_host_bridge_release(host, release_pci_root_info, info);
+ return host->bus;
}
static int is_valid_resource(struct pci_dev *dev, int idx)