PCI: Expose devm_pci_alloc_host_bridge_release()

devm_pci_alloc_host_bridge() allocates a struct pci_host_bridge and also
parses device tree resources and claims them.  There are drivers, e.g.,
pcie-iproc-bcma.c, that need to allocate a pci_host_bridge but do not need
device tree resources.

Expose devm_pci_alloc_host_bridge_release() so they can avoid the device
tree parts by calling pci_alloc_host_bridge() directly and adding the devm
release function manually.

[bhelgaas: add EXPORT_SYMBOL]
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
Link: https://patch.msgid.link/20261013220421.1588051-2-bhelgaas@google.com
This commit is contained in:
Bjorn Helgaas 2026-10-13 17:04:20 -05:00
parent cee9395acd
commit 39d1c645bb
2 changed files with 3 additions and 1 deletions

View File

@ -502,6 +502,7 @@ enum pci_bar_type {
pci_bar_mem64, /* A 64-bit memory BAR */
};
void devm_pci_alloc_host_bridge_release(void *data);
struct device *pci_get_host_bridge_device(struct pci_dev *dev);
void pci_put_host_bridge_device(struct device *dev);

View File

@ -696,10 +696,11 @@ struct pci_host_bridge *pci_alloc_host_bridge(size_t priv)
}
EXPORT_SYMBOL(pci_alloc_host_bridge);
static void devm_pci_alloc_host_bridge_release(void *data)
void devm_pci_alloc_host_bridge_release(void *data)
{
pci_free_host_bridge(data);
}
EXPORT_SYMBOL(devm_pci_alloc_host_bridge_release);
struct pci_host_bridge *devm_pci_alloc_host_bridge(struct device *dev,
size_t priv)