[PATCH v2] PCI: imx6: Support building it as a module

From: Jindong Yue
Date: Mon Jul 31 2023 - 23:06:33 EST


Change config from bool to tristate and add MODULE_LICENSE to support
building pci-imx6 as a module.

Also export dw_pcie_ep_raise_msix_irq() to fix build error when
CONFIG_PCIE_DW_EP=y is set:
ERROR: modpost: "dw_pcie_ep_raise_msix_irq"
[drivers/pci/controller/dwc/pci-imx6.ko] undefined!
This error was found by kernel test robot <lkp@xxxxxxxxx>.

Signed-off-by: Jindong Yue <jindong.yue@xxxxxxx>
---
v1 -> v2:
Export dw_pcie_ep_raise_msix_irq to fix build error
---
drivers/pci/controller/dwc/Kconfig | 6 +++---
drivers/pci/controller/dwc/pci-imx6.c | 1 +
drivers/pci/controller/dwc/pcie-designware-ep.c | 1 +
3 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/pci/controller/dwc/Kconfig b/drivers/pci/controller/dwc/Kconfig
index ab96da43e0c2..db96cff8b11f 100644
--- a/drivers/pci/controller/dwc/Kconfig
+++ b/drivers/pci/controller/dwc/Kconfig
@@ -71,10 +71,10 @@ config PCIE_BT1
in host mode. It's based on the Synopsys DWC PCIe v4.60a IP-core.

config PCI_IMX6
- bool
+ tristate

config PCI_IMX6_HOST
- bool "Freescale i.MX6/7/8 PCIe controller (host mode)"
+ tristate "Freescale i.MX6/7/8 PCIe controller (host mode)"
depends on ARCH_MXC || COMPILE_TEST
depends on PCI_MSI
select PCIE_DW_HOST
@@ -86,7 +86,7 @@ config PCI_IMX6_HOST
DesignWare core functions to implement the driver.

config PCI_IMX6_EP
- bool "Freescale i.MX6/7/8 PCIe controller (endpoint mode)"
+ tristate "Freescale i.MX6/7/8 PCIe controller (endpoint mode)"
depends on ARCH_MXC || COMPILE_TEST
depends on PCI_ENDPOINT
select PCIE_DW_EP
diff --git a/drivers/pci/controller/dwc/pci-imx6.c b/drivers/pci/controller/dwc/pci-imx6.c
index 235ead4c807f..1050149ac9ad 100644
--- a/drivers/pci/controller/dwc/pci-imx6.c
+++ b/drivers/pci/controller/dwc/pci-imx6.c
@@ -1609,3 +1609,4 @@ static int __init imx6_pcie_init(void)
return platform_driver_register(&imx6_pcie_driver);
}
device_initcall(imx6_pcie_init);
+MODULE_LICENSE("GPL");
diff --git a/drivers/pci/controller/dwc/pcie-designware-ep.c b/drivers/pci/controller/dwc/pcie-designware-ep.c
index f9182f8d552f..ec1b024a758e 100644
--- a/drivers/pci/controller/dwc/pcie-designware-ep.c
+++ b/drivers/pci/controller/dwc/pcie-designware-ep.c
@@ -609,6 +609,7 @@ int dw_pcie_ep_raise_msix_irq(struct dw_pcie_ep *ep, u8 func_no,

return 0;
}
+EXPORT_SYMBOL_GPL(dw_pcie_ep_raise_msix_irq);

void dw_pcie_ep_exit(struct dw_pcie_ep *ep)
{
--
2.36.0