init.c (d9e5481fca74f870cf2fc2f90a0e77e85c0b5b86) init.c (6e7f3ee97bbe2c7d7a53b7dbd7a08a579e03c8c9)
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>

--- 835 unchanged lines hidden (view full) ---

844 err = idxd_driver_register(&idxd_dmaengine_drv);
845 if (err < 0)
846 goto err_idxd_dmaengine_driver_register;
847
848 err = idxd_driver_register(&idxd_user_drv);
849 if (err < 0)
850 goto err_idxd_user_driver_register;
851
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>

--- 835 unchanged lines hidden (view full) ---

844 err = idxd_driver_register(&idxd_dmaengine_drv);
845 if (err < 0)
846 goto err_idxd_dmaengine_driver_register;
847
848 err = idxd_driver_register(&idxd_user_drv);
849 if (err < 0)
850 goto err_idxd_user_driver_register;
851
852 err = idxd_driver_register(&dsa_drv);
853 if (err < 0)
854 goto err_dsa_driver_register;
855
856 err = idxd_cdev_register();
857 if (err)
858 goto err_cdev_register;
859
860 err = pci_register_driver(&idxd_pci_driver);
861 if (err)
862 goto err_pci_register;
863
864 return 0;
865
866err_pci_register:
867 idxd_cdev_remove();
868err_cdev_register:
852 err = idxd_cdev_register();
853 if (err)
854 goto err_cdev_register;
855
856 err = pci_register_driver(&idxd_pci_driver);
857 if (err)
858 goto err_pci_register;
859
860 return 0;
861
862err_pci_register:
863 idxd_cdev_remove();
864err_cdev_register:
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:
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);
865 idxd_driver_unregister(&idxd_user_drv);
866err_idxd_user_driver_register:
867 idxd_driver_unregister(&idxd_dmaengine_drv);
868err_idxd_dmaengine_driver_register:
869 idxd_driver_unregister(&idxd_drv);
870err_idxd_driver_register:
871 return err;
872}
873module_init(idxd_init_module);
874
875static void __exit idxd_exit_module(void)
876{
877 idxd_driver_unregister(&idxd_user_drv);
878 idxd_driver_unregister(&idxd_dmaengine_drv);
879 idxd_driver_unregister(&idxd_drv);
886 idxd_driver_unregister(&dsa_drv);
887 pci_unregister_driver(&idxd_pci_driver);
888 idxd_cdev_remove();
889 perfmon_exit();
890}
891module_exit(idxd_exit_module);
880 pci_unregister_driver(&idxd_pci_driver);
881 idxd_cdev_remove();
882 perfmon_exit();
883}
884module_exit(idxd_exit_module);