From: Marc Zyngier Date: Tue, 1 Apr 2025 09:17:04 +0000 (+0100) Subject: PCI: ecam: Allow cfg->priv to be pre-populated from the root port device X-Git-Tag: v6.16-rc1~50^2~14^2~9 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4900454b4f819e88e9c57ed93542bf9325d7e161;p=thirdparty%2Fkernel%2Flinux.git PCI: ecam: Allow cfg->priv to be pre-populated from the root port device In order to decouple ecam config space creation from probing via pci_host_common_probe(), allow the private pointer to be populated via the device drvdata pointer. Crucially, this is set before calling ops->init(), allowing that particular callback to have access to probe data. This should have no impact on existing code which ignores the current value of cfg->priv. Signed-off-by: Marc Zyngier Signed-off-by: Manivannan Sadhasivam Tested-by: Janne Grunau Reviewed-by: Rob Herring (Arm) Reviewed-by: Manivannan Sadhasivam Acked-by: Alyssa Rosenzweig Link: https://patch.msgid.link/20250401091713.2765724-5-maz@kernel.org --- diff --git a/drivers/pci/ecam.c b/drivers/pci/ecam.c index 260b7de2dbd57..2c5e6446e00ee 100644 --- a/drivers/pci/ecam.c +++ b/drivers/pci/ecam.c @@ -84,6 +84,8 @@ struct pci_config_window *pci_ecam_create(struct device *dev, goto err_exit_iomap; } + cfg->priv = dev_get_drvdata(dev); + if (ops->init) { err = ops->init(cfg); if (err)