[PATCH] PCI: host-generic: Move bridge allocation outside of pci_host_common_init()
Bjorn Helgaas
helgaas at kernel.org
Mon Nov 24 13:39:37 PST 2025
On Thu, Nov 20, 2025 at 11:36:30AM +0000, Marc Zyngier wrote:
> Having the host bridge allocation inside pci_host_common_init() results
> in a lot of complexity in the pcie-apple driver (the only direct user
> of this function outside of code PCI code).
>
> It forces the allocation of driver-specific tracking structures outside
> of the bridge allocation, which in turns requires it to use inneficient
> data structures to match the bridge and the private structre as needed.
Nits since you plan to repost:
s/in turns/in turn/ (maybe a British/American idiom difference?)
s/inneficient/inefficient/
s/structre/structure/
> Instead, let the bridge structure be passed to pci_host_common_init(),
> allowing the driver to allocate it together with the private data,
> as it is usually intended. The driver can then retrieve the bridge
> via the owning device attached to the PCI config window structure.
> This allows the pcie-apple driver to be significantly simplified.
Nice simplification, thanks for doing this!
Bjorn
More information about the linux-arm-kernel
mailing list