|
|
@@ -535,16 +535,9 @@ static void pci_release_host_bridge_dev(struct device *dev)
|
|
|
kfree(to_pci_host_bridge(dev));
|
|
|
}
|
|
|
|
|
|
-struct pci_host_bridge *pci_alloc_host_bridge(size_t priv)
|
|
|
+static void pci_init_host_bridge(struct pci_host_bridge *bridge)
|
|
|
{
|
|
|
- struct pci_host_bridge *bridge;
|
|
|
-
|
|
|
- bridge = kzalloc(sizeof(*bridge) + priv, GFP_KERNEL);
|
|
|
- if (!bridge)
|
|
|
- return NULL;
|
|
|
-
|
|
|
INIT_LIST_HEAD(&bridge->windows);
|
|
|
- bridge->dev.release = pci_release_host_bridge_dev;
|
|
|
|
|
|
/*
|
|
|
* We assume we can manage these PCIe features. Some systems may
|
|
|
@@ -557,6 +550,18 @@ struct pci_host_bridge *pci_alloc_host_bridge(size_t priv)
|
|
|
bridge->native_shpc_hotplug = 1;
|
|
|
bridge->native_pme = 1;
|
|
|
bridge->native_ltr = 1;
|
|
|
+}
|
|
|
+
|
|
|
+struct pci_host_bridge *pci_alloc_host_bridge(size_t priv)
|
|
|
+{
|
|
|
+ struct pci_host_bridge *bridge;
|
|
|
+
|
|
|
+ bridge = kzalloc(sizeof(*bridge) + priv, GFP_KERNEL);
|
|
|
+ if (!bridge)
|
|
|
+ return NULL;
|
|
|
+
|
|
|
+ pci_init_host_bridge(bridge);
|
|
|
+ bridge->dev.release = pci_release_host_bridge_dev;
|
|
|
|
|
|
return bridge;
|
|
|
}
|
|
|
@@ -571,7 +576,7 @@ struct pci_host_bridge *devm_pci_alloc_host_bridge(struct device *dev,
|
|
|
if (!bridge)
|
|
|
return NULL;
|
|
|
|
|
|
- INIT_LIST_HEAD(&bridge->windows);
|
|
|
+ pci_init_host_bridge(bridge);
|
|
|
bridge->dev.release = devm_pci_release_host_bridge_dev;
|
|
|
|
|
|
return bridge;
|