aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers/pci/controller/pcie-altera-msi.c
diff options
context:
space:
mode:
authorLey Foon Tan <ley.foon.tan@intel.com>2019-04-24 12:57:15 +0800
committerLorenzo Pieralisi <lorenzo.pieralisi@arm.com>2019-05-30 15:34:54 +0100
commitc7ddfd3514f2702a70e9ff86504cafa856dd16b2 (patch)
tree29c44e3c33e571e59b4006bde2ab805701af48e0 /drivers/pci/controller/pcie-altera-msi.c
parentPCI: altera: Allow building as module (diff)
downloadwireguard-linux-c7ddfd3514f2702a70e9ff86504cafa856dd16b2.tar.xz
wireguard-linux-c7ddfd3514f2702a70e9ff86504cafa856dd16b2.zip
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 <ley.foon.tan@intel.com> Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Diffstat (limited to 'drivers/pci/controller/pcie-altera-msi.c')
-rw-r--r--drivers/pci/controller/pcie-altera-msi.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/pci/controller/pcie-altera-msi.c b/drivers/pci/controller/pcie-altera-msi.c
index 025ef7d9a046..16d938920ca5 100644
--- a/drivers/pci/controller/pcie-altera-msi.c
+++ b/drivers/pci/controller/pcie-altera-msi.c
@@ -10,6 +10,7 @@
#include <linux/interrupt.h>
#include <linux/irqchip/chained_irq.h>
#include <linux/init.h>
+#include <linux/module.h>
#include <linux/msi.h>
#include <linux/of_address.h>
#include <linux/of_irq.h>
@@ -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");