]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
PCI: host-generic: Rename and export gen_pci_init() for PCIe controller drivers
authorMayank Rana <mayank.rana@oss.qualcomm.com>
Mon, 16 Jun 2025 22:42:57 +0000 (15:42 -0700)
committerManivannan Sadhasivam <mani@kernel.org>
Tue, 1 Jul 2025 14:31:26 +0000 (20:01 +0530)
Rename gen_pci_init() API as pci_host_common_ecam_create() and export it to
allow the PCIe controller drivers to create and configure the ECAM region.

Note that this API should only used by the drivers managing the drvdata on
their own. Rest should continue using pci_host_common_init() API.

Signed-off-by: Mayank Rana <mayank.rana@oss.qualcomm.com>
[mani: commit message rewording]
Signed-off-by: Manivannan Sadhasivam <mani@kernel.org>
Link: https://patch.msgid.link/20250616224259.3549811-3-mayank.rana@oss.qualcomm.com
drivers/pci/controller/pci-host-common.c
drivers/pci/controller/pci-host-common.h

index b0992325dd65f0da8e216ec8a2153af365225d1d..5b61b5a9e0f9eb73f51ce371e8e3f0549e3b0783 100644 (file)
@@ -22,7 +22,7 @@ static void gen_pci_unmap_cfg(void *ptr)
        pci_ecam_free((struct pci_config_window *)ptr);
 }
 
-static struct pci_config_window *gen_pci_init(struct device *dev,
+struct pci_config_window *pci_host_common_ecam_create(struct device *dev,
                struct pci_host_bridge *bridge, const struct pci_ecam_ops *ops)
 {
        int err;
@@ -50,6 +50,7 @@ static struct pci_config_window *gen_pci_init(struct device *dev,
 
        return cfg;
 }
+EXPORT_SYMBOL_GPL(pci_host_common_ecam_create);
 
 int pci_host_common_init(struct platform_device *pdev,
                         const struct pci_ecam_ops *ops)
@@ -65,7 +66,7 @@ int pci_host_common_init(struct platform_device *pdev,
        of_pci_check_probe_only();
 
        /* Parse and map our Configuration Space windows */
-       cfg = gen_pci_init(dev, bridge, ops);
+       cfg = pci_host_common_ecam_create(dev, bridge, ops);
        if (IS_ERR(cfg))
                return PTR_ERR(cfg);
 
index 65bd9e032353827221a6af59858c46fdbe5916bf..51c35ec0cf37df4c149cd848038284f38e6abfb0 100644 (file)
@@ -17,4 +17,6 @@ int pci_host_common_init(struct platform_device *pdev,
                         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