diff options
| author | Minda Chen <minda.chen@starfivetech.com> | 2024-03-28 12:18:21 +0300 | 
|---|---|---|
| committer | Bjorn Helgaas <bhelgaas@google.com> | 2024-05-28 19:15:29 +0300 | 
| commit | d76ef0531c0794d22eacfb1f0f887590e92fbf8e (patch) | |
| tree | 26eaa3231e3f66ea6e16fb36541eaeb53376472f /drivers/pci/controller/plda/pcie-microchip-host.c | |
| parent | 76c9113968079140cb2f885631db422170f32105 (diff) | |
| download | linux-d76ef0531c0794d22eacfb1f0f887590e92fbf8e.tar.xz | |
PCI: plda: Pass pci_host_bridge to plda_pcie_setup_iomems()
plda_pcie_setup_iomems() needs the bridge->windows list from struct
pci_host_bridge and is currently used only by pcie-microchip-host.c.  This
driver uses pci_host_common_probe(), which sets a pci_host_bridge as the
drvdata, so plda_pcie_setup_iomems() used platform_get_drvdata() to find
the pci_host_bridge.
But we also want to use plda_pcie_setup_iomems() in the new pcie-starfive.c
driver, which does not use pci_host_common_probe() and will have struct
starfive_jh7110_pcie as its drvdata, so pass the pci_host_bridge directly
to plda_pcie_setup_iomems() so it doesn't need platform_get_drvdata() to
find it.
Link: https://lore.kernel.org/linux-pci/20240328091835.14797-9-minda.chen@starfivetech.com
Signed-off-by: Minda Chen <minda.chen@starfivetech.com>
Signed-off-by: Krzysztof WilczyĆski <kwilczynski@kernel.org>
[bhelgaas: commit log, reorder to where this is needed]
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
Diffstat (limited to 'drivers/pci/controller/plda/pcie-microchip-host.c')
| -rw-r--r-- | drivers/pci/controller/plda/pcie-microchip-host.c | 3 | 
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/pci/controller/plda/pcie-microchip-host.c b/drivers/pci/controller/plda/pcie-microchip-host.c index 36e4aef3e526..48f60a04b740 100644 --- a/drivers/pci/controller/plda/pcie-microchip-host.c +++ b/drivers/pci/controller/plda/pcie-microchip-host.c @@ -616,6 +616,7 @@ static int mc_platform_init(struct pci_config_window *cfg)  {  	struct device *dev = cfg->parent;  	struct platform_device *pdev = to_platform_device(dev); +	struct pci_host_bridge *bridge = platform_get_drvdata(pdev);  	void __iomem *bridge_base_addr =  		port->axi_base_addr + MC_PCIE_BRIDGE_ADDR;  	int ret; @@ -629,7 +630,7 @@ static int mc_platform_init(struct pci_config_window *cfg)  	mc_pcie_enable_msi(port, cfg->win);  	/* Configure non-config space outbound ranges */ -	ret = plda_pcie_setup_iomems(pdev, &port->plda); +	ret = plda_pcie_setup_iomems(bridge, &port->plda);  	if (ret)  		return ret;  | 
