Commit e8779ac7 authored by Liviu Dudau's avatar Liviu Dudau
Browse files

pci: Fix crash on pcibios_root_bridge_prepare()

Commit 003b5e6f33242 changed the order of creation between bridge
and the root bus, but pcibios_root_bridge_prepare() is expecting
the root bus to be properly configured when called. Move the call
after the bus has been initialised (back in the original spot).
Signed-off-by: Liviu Dudau's avatarLiviu Dudau <>
parent e304419d
......@@ -1734,9 +1734,6 @@ struct pci_bus *pci_create_root_bus_in_domain(struct device *parent,
bridge->dev.parent = parent;
bridge->dev.release = pci_release_host_bridge_dev;
bridge->domain_nr = domain;
error = pcibios_root_bridge_prepare(bridge);
if (error)
goto err_out;
b = pci_alloc_bus();
if (!b) {
......@@ -1757,6 +1754,10 @@ struct pci_bus *pci_create_root_bus_in_domain(struct device *parent,
bridge->bus = b;
dev_set_name(&bridge->dev, "pci%04x:%02x", bridge->domain_nr, bus);
error = pcibios_root_bridge_prepare(bridge);
if (error)
goto err_out;
error = device_register(&bridge->dev);
if (error) {
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment