|
@@ -1632,6 +1632,18 @@ unsigned int pci_scan_child_bus(struct pci_bus *bus)
|
|
|
return max;
|
|
|
}
|
|
|
|
|
|
+/**
|
|
|
+ * pcibios_root_bridge_prepare - Platform-specific host bridge setup.
|
|
|
+ * @bridge: Host bridge to set up.
|
|
|
+ *
|
|
|
+ * Default empty implementation. Replace with an architecture-specific setup
|
|
|
+ * routine, if necessary.
|
|
|
+ */
|
|
|
+int __weak pcibios_root_bridge_prepare(struct pci_host_bridge *bridge)
|
|
|
+{
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
struct pci_bus *pci_create_root_bus(struct device *parent, int bus,
|
|
|
struct pci_ops *ops, void *sysdata, struct list_head *resources)
|
|
|
{
|
|
@@ -1665,6 +1677,10 @@ struct pci_bus *pci_create_root_bus(struct device *parent, int bus,
|
|
|
bridge->dev.parent = parent;
|
|
|
bridge->dev.release = pci_release_bus_bridge_dev;
|
|
|
dev_set_name(&bridge->dev, "pci%04x:%02x", pci_domain_nr(b), bus);
|
|
|
+ error = pcibios_root_bridge_prepare(bridge);
|
|
|
+ if (error)
|
|
|
+ goto bridge_dev_reg_err;
|
|
|
+
|
|
|
error = device_register(&bridge->dev);
|
|
|
if (error)
|
|
|
goto bridge_dev_reg_err;
|