Merge tag 'landlock-6.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/mic...
[platform/kernel/linux-starfive.git] / drivers / misc / ocxl / main.c
1 // SPDX-License-Identifier: GPL-2.0+
2 // Copyright 2017 IBM Corp.
3 #include <linux/module.h>
4 #include <linux/pci.h>
5 #include <asm/mmu.h>
6 #include "ocxl_internal.h"
7
8 static int __init init_ocxl(void)
9 {
10         int rc = 0;
11
12         if (!tlbie_capable)
13                 return -EINVAL;
14
15         rc = ocxl_file_init();
16         if (rc)
17                 return rc;
18
19         rc = pci_register_driver(&ocxl_pci_driver);
20         if (rc) {
21                 ocxl_file_exit();
22                 return rc;
23         }
24         return 0;
25 }
26
27 static void exit_ocxl(void)
28 {
29         pci_unregister_driver(&ocxl_pci_driver);
30         ocxl_file_exit();
31 }
32
33 module_init(init_ocxl);
34 module_exit(exit_ocxl);
35
36 MODULE_DESCRIPTION("Open Coherent Accelerator");
37 MODULE_LICENSE("GPL");