mirror of
https://github.com/torvalds/linux.git
synced 2025-12-07 20:06:24 +00:00
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 core PCI code). It forces the allocation of driver-specific tracking structures outside of the bridge allocation, which in turn requires it to use inefficient data structures to match the bridge and the private structure as needed. 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. Both core and driver code are changed in one go to avoid going via a transitional interface. Signed-off-by: Marc Zyngier <maz@kernel.org> Signed-off-by: Manivannan Sadhasivam <mani@kernel.org> Reviewed-by: Radu Rendec <rrendec@redhat.com> Cc: Bjorn Helgaas <bhelgaas@google.com> Cc: Manivannan Sadhasivam <mani@kernel.org> Cc: Rob Herring <robh@kernel.org> Cc: Krzysztof Wilczyński <kwilczynski@kernel.org> Cc: Lorenzo Pieralisi <lpieralisi@kernel.org> Link: https://lore.kernel.org/r/86jyzms036.wl-maz@kernel.org Link: https://patch.msgid.link/20251125102726.865617-1-maz@kernel.org
24 lines
651 B
C
24 lines
651 B
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
/*
|
|
* Common library for PCI host controller drivers
|
|
*
|
|
* Copyright (C) 2014 ARM Limited
|
|
*
|
|
* Author: Will Deacon <will.deacon@arm.com>
|
|
*/
|
|
|
|
#ifndef _PCI_HOST_COMMON_H
|
|
#define _PCI_HOST_COMMON_H
|
|
|
|
struct pci_ecam_ops;
|
|
|
|
int pci_host_common_probe(struct platform_device *pdev);
|
|
int pci_host_common_init(struct platform_device *pdev,
|
|
struct pci_host_bridge *bridge,
|
|
const struct pci_ecam_ops *ops);
|
|
void pci_host_common_remove(struct platform_device *pdev);
|
|
|
|
struct pci_config_window *pci_host_common_ecam_create(struct device *dev,
|
|
struct pci_host_bridge *bridge, const struct pci_ecam_ops *ops);
|
|
#endif
|