|
@@ -478,9 +478,16 @@ struct pci_bus *pci_acpi_scan_root(struct acpi_pci_root *root)
|
|
|
|
|
|
int pcibios_root_bridge_prepare(struct pci_host_bridge *bridge)
|
|
int pcibios_root_bridge_prepare(struct pci_host_bridge *bridge)
|
|
{
|
|
{
|
|
- struct pci_controller *controller = bridge->bus->sysdata;
|
|
|
|
-
|
|
|
|
- ACPI_COMPANION_SET(&bridge->dev, controller->companion);
|
|
|
|
|
|
+ /*
|
|
|
|
+ * We pass NULL as parent to pci_create_root_bus(), so if it is not NULL
|
|
|
|
+ * here, pci_create_root_bus() has been called by someone else and
|
|
|
|
+ * sysdata is likely to be different from what we expect. Let it go in
|
|
|
|
+ * that case.
|
|
|
|
+ */
|
|
|
|
+ if (!bridge->dev.parent) {
|
|
|
|
+ struct pci_controller *controller = bridge->bus->sysdata;
|
|
|
|
+ ACPI_COMPANION_SET(&bridge->dev, controller->companion);
|
|
|
|
+ }
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
|