From: Ley Foon Tan Date: Wed, 24 Apr 2019 04:57:15 +0000 (+0800) Subject: PCI: altera-msi: Allow building as module X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=c7ddfd3514f2702a70e9ff86504cafa856dd16b2;p=linux.git PCI: altera-msi: Allow building as module Altera MSI IP is a soft IP and is only available after an FPGA image (with design containing it) is programmed. Make driver modulable to support use case FPGA image is programmed the after kernel has booted, so that the driver can be loaded upon request. Signed-off-by: Ley Foon Tan Signed-off-by: Lorenzo Pieralisi --- diff --git a/drivers/pci/controller/Kconfig b/drivers/pci/controller/Kconfig index 89906351bd3fd..fe9f9f13ce11c 100644 --- a/drivers/pci/controller/Kconfig +++ b/drivers/pci/controller/Kconfig @@ -181,7 +181,7 @@ config PCIE_ALTERA FPGA. config PCIE_ALTERA_MSI - bool "Altera PCIe MSI feature" + tristate "Altera PCIe MSI feature" depends on PCIE_ALTERA depends on PCI_MSI_IRQ_DOMAIN help diff --git a/drivers/pci/controller/pcie-altera-msi.c b/drivers/pci/controller/pcie-altera-msi.c index 025ef7d9a046f..16d938920ca57 100644 --- a/drivers/pci/controller/pcie-altera-msi.c +++ b/drivers/pci/controller/pcie-altera-msi.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -288,4 +289,13 @@ static int __init altera_msi_init(void) { return platform_driver_register(&altera_msi_driver); } + +static void __exit altera_msi_exit(void) +{ + platform_driver_unregister(&altera_msi_driver); +} + subsys_initcall(altera_msi_init); +MODULE_DEVICE_TABLE(of, altera_msi_of_match); +module_exit(altera_msi_exit); +MODULE_LICENSE("GPL v2");