init.c (448c3de8ac8353fc4447738ae3c56c4eb6c2131d) | init.c (d9e5481fca74f870cf2fc2f90a0e77e85c0b5b86) |
---|---|
1// SPDX-License-Identifier: GPL-2.0 2/* Copyright(c) 2019 Intel Corporation. All rights rsvd. */ 3#include <linux/init.h> 4#include <linux/kernel.h> 5#include <linux/module.h> 6#include <linux/slab.h> 7#include <linux/pci.h> 8#include <linux/interrupt.h> --- 12 unchanged lines hidden (view full) --- 21#include "../dmaengine.h" 22#include "registers.h" 23#include "idxd.h" 24#include "perfmon.h" 25 26MODULE_VERSION(IDXD_DRIVER_VERSION); 27MODULE_LICENSE("GPL v2"); 28MODULE_AUTHOR("Intel Corporation"); | 1// SPDX-License-Identifier: GPL-2.0 2/* Copyright(c) 2019 Intel Corporation. All rights rsvd. */ 3#include <linux/init.h> 4#include <linux/kernel.h> 5#include <linux/module.h> 6#include <linux/slab.h> 7#include <linux/pci.h> 8#include <linux/interrupt.h> --- 12 unchanged lines hidden (view full) --- 21#include "../dmaengine.h" 22#include "registers.h" 23#include "idxd.h" 24#include "perfmon.h" 25 26MODULE_VERSION(IDXD_DRIVER_VERSION); 27MODULE_LICENSE("GPL v2"); 28MODULE_AUTHOR("Intel Corporation"); |
29MODULE_IMPORT_NS(IDXD); |
|
29 30static bool sva = true; 31module_param(sva, bool, 0644); 32MODULE_PARM_DESC(sva, "Toggle SVA support on/off"); 33 34#define DRV_NAME "idxd" 35 36bool support_enqcmd; --- 794 unchanged lines hidden (view full) --- 831 832 if (!cpu_feature_enabled(X86_FEATURE_ENQCMD)) 833 pr_warn("Platform does not have ENQCMD(S) support.\n"); 834 else 835 support_enqcmd = true; 836 837 perfmon_init(); 838 | 30 31static bool sva = true; 32module_param(sva, bool, 0644); 33MODULE_PARM_DESC(sva, "Toggle SVA support on/off"); 34 35#define DRV_NAME "idxd" 36 37bool support_enqcmd; --- 794 unchanged lines hidden (view full) --- 832 833 if (!cpu_feature_enabled(X86_FEATURE_ENQCMD)) 834 pr_warn("Platform does not have ENQCMD(S) support.\n"); 835 else 836 support_enqcmd = true; 837 838 perfmon_init(); 839 |
839 err = idxd_register_bus_type(); 840 if (err < 0) 841 return err; 842 | |
843 err = idxd_driver_register(&idxd_drv); 844 if (err < 0) 845 goto err_idxd_driver_register; 846 847 err = idxd_driver_register(&idxd_dmaengine_drv); 848 if (err < 0) 849 goto err_idxd_dmaengine_driver_register; 850 --- 21 unchanged lines hidden (view full) --- 872 idxd_driver_unregister(&dsa_drv); 873err_dsa_driver_register: 874 idxd_driver_unregister(&idxd_user_drv); 875err_idxd_user_driver_register: 876 idxd_driver_unregister(&idxd_dmaengine_drv); 877err_idxd_dmaengine_driver_register: 878 idxd_driver_unregister(&idxd_drv); 879err_idxd_driver_register: | 840 err = idxd_driver_register(&idxd_drv); 841 if (err < 0) 842 goto err_idxd_driver_register; 843 844 err = idxd_driver_register(&idxd_dmaengine_drv); 845 if (err < 0) 846 goto err_idxd_dmaengine_driver_register; 847 --- 21 unchanged lines hidden (view full) --- 869 idxd_driver_unregister(&dsa_drv); 870err_dsa_driver_register: 871 idxd_driver_unregister(&idxd_user_drv); 872err_idxd_user_driver_register: 873 idxd_driver_unregister(&idxd_dmaengine_drv); 874err_idxd_dmaengine_driver_register: 875 idxd_driver_unregister(&idxd_drv); 876err_idxd_driver_register: |
880 idxd_unregister_bus_type(); | |
881 return err; 882} 883module_init(idxd_init_module); 884 885static void __exit idxd_exit_module(void) 886{ 887 idxd_driver_unregister(&idxd_user_drv); 888 idxd_driver_unregister(&idxd_dmaengine_drv); 889 idxd_driver_unregister(&idxd_drv); 890 idxd_driver_unregister(&dsa_drv); 891 pci_unregister_driver(&idxd_pci_driver); 892 idxd_cdev_remove(); | 877 return err; 878} 879module_init(idxd_init_module); 880 881static void __exit idxd_exit_module(void) 882{ 883 idxd_driver_unregister(&idxd_user_drv); 884 idxd_driver_unregister(&idxd_dmaengine_drv); 885 idxd_driver_unregister(&idxd_drv); 886 idxd_driver_unregister(&dsa_drv); 887 pci_unregister_driver(&idxd_pci_driver); 888 idxd_cdev_remove(); |
893 idxd_unregister_bus_type(); | |
894 perfmon_exit(); 895} 896module_exit(idxd_exit_module); | 889 perfmon_exit(); 890} 891module_exit(idxd_exit_module); |
897 898int __idxd_driver_register(struct idxd_device_driver *idxd_drv, struct module *owner, 899 const char *mod_name) 900{ 901 struct device_driver *drv = &idxd_drv->drv; 902 903 if (!idxd_drv->type) { 904 pr_debug("driver type not set (%ps)\n", __builtin_return_address(0)); 905 return -EINVAL; 906 } 907 908 drv->name = idxd_drv->name; 909 drv->bus = &dsa_bus_type; 910 drv->owner = owner; 911 drv->mod_name = mod_name; 912 913 return driver_register(drv); 914} 915 916void idxd_driver_unregister(struct idxd_device_driver *idxd_drv) 917{ 918 driver_unregister(&idxd_drv->drv); 919} | |