From: Bjorn Helgaas <helgaas@kernel.org>
To: Semih Baskan <strst.gs@gmail.com>
Cc: "Manivannan Sadhasivam" <mani@kernel.org>,
"Lorenzo Pieralisi" <lpieralisi@kernel.org>,
"Krzysztof Wilczyński" <kwilczynski@kernel.org>,
"Rob Herring" <robh@kernel.org>, "Ray Jui" <rjui@broadcom.com>,
"Scott Branden" <sbranden@broadcom.com>,
"Rafał Miłecki" <rafal@milecki.pl>,
"Rafał Miłecki" <zajec5@gmail.com>,
"Florian Fainelli" <florian.fainelli@broadcom.com>,
"Arnd Bergmann" <arnd@arndb.de>, "Rosen Penev" <rosenp@gmail.com>,
"Rani Hod" <rani.hod@gmail.com>,
bcm-kernel-feedback-list@broadcom.com, linux-pci@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org,
"Bjorn Helgaas" <bhelgaas@google.com>
Subject: [PATCH v4 1/2] PCI: Expose devm_pci_alloc_host_bridge_release()
Date: Tue, 13 Oct 2026 17:04:20 -0500 [thread overview]
Message-ID: <20261013220421.1588051-2-bhelgaas@google.com> (raw)
In-Reply-To: <20261013220421.1588051-1-bhelgaas@google.com>
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.
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
---
drivers/pci/pci.h | 1 +
drivers/pci/probe.c | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h
index ba3c3fddddc2..5e21cd29cc7c 100644
--- a/drivers/pci/pci.h
+++ b/drivers/pci/pci.h
@@ -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);
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index 27008e2ea5af..e214da95ca94 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -696,7 +696,7 @@ 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);
}
--
2.53.0
next prev parent reply other threads:[~2026-10-13 22:04 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-13 22:04 [PATCH v4 0/2] PCI: iproc-bcma: Use EROM instead of devicetree Bjorn Helgaas
2026-10-13 22:04 ` Bjorn Helgaas [this message]
2026-10-14 11:00 ` [PATCH v4 1/2] PCI: Expose devm_pci_alloc_host_bridge_release() Manivannan Sadhasivam
2026-10-13 22:04 ` [PATCH v4 2/2] PCI: iproc: Use the EROM outbound window on BCMA Bjorn Helgaas
2026-10-14 1:17 ` Semih Baskan
2026-10-14 13:34 ` [PATCH v4 0/2] PCI: iproc-bcma: Use EROM instead of devicetree Manivannan Sadhasivam
2026-10-14 13:34 ` Manivannan Sadhasivam
2026-10-15 17:31 ` Florian Fainelli
2026-10-15 18:51 ` Semih Baskan
2026-10-15 19:10 ` Florian Fainelli
2026-10-15 20:45 ` Bjorn Helgaas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261013220421.1588051-2-bhelgaas@google.com \
--to=helgaas@kernel.org \
--cc=arnd@arndb.de \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=bhelgaas@google.com \
--cc=florian.fainelli@broadcom.com \
--cc=kwilczynski@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=lpieralisi@kernel.org \
--cc=mani@kernel.org \
--cc=rafal@milecki.pl \
--cc=rani.hod@gmail.com \
--cc=rjui@broadcom.com \
--cc=robh@kernel.org \
--cc=rosenp@gmail.com \
--cc=sbranden@broadcom.com \
--cc=strst.gs@gmail.com \
--cc=zajec5@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox