Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
| 2 | // Copyright 2017 IBM Corp. |
| 3 | #include <linux/module.h> |
| 4 | #include <linux/pci.h> |
David Brazdil | 0f672f6 | 2019-12-10 10:32:29 +0000 | [diff] [blame^] | 5 | #include <asm/mmu.h> |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 6 | #include "ocxl_internal.h" |
| 7 | |
| 8 | static int __init init_ocxl(void) |
| 9 | { |
| 10 | int rc = 0; |
| 11 | |
David Brazdil | 0f672f6 | 2019-12-10 10:32:29 +0000 | [diff] [blame^] | 12 | if (!tlbie_capable) |
| 13 | return -EINVAL; |
| 14 | |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 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"); |