summaryrefslogtreecommitdiffstats
path: root/drivers/vfio/pci/mlx5/main.c
diff options
context:
space:
mode:
authorShang XiaoJing <shangxiaojing@huawei.com>2022-09-22 14:35:07 +0200
committerAlex Williamson <alex.williamson@redhat.com>2022-11-10 00:38:31 +0100
commitcd48ebc5c4f2e94830b238f035ebf04f1c3a4433 (patch)
treedfe3aafd05032b3154e5294063f12e89abaaf4db /drivers/vfio/pci/mlx5/main.c
parentMAINTAINERS: git://github -> https://github.com for awilliam (diff)
downloadlinux-cd48ebc5c4f2e94830b238f035ebf04f1c3a4433.tar.xz
linux-cd48ebc5c4f2e94830b238f035ebf04f1c3a4433.zip
vfio/mlx5: Switch to use module_pci_driver() macro
Since pci provides the helper macro module_pci_driver(), we may replace the module_init/exit with it. Signed-off-by: Shang XiaoJing <shangxiaojing@huawei.com> Reviewed-by: Yishai Hadas <yishaih@nvidia.com> Reviewed-by: Jason Gunthorpe <jgg@nvidia.com> Link: https://lore.kernel.org/r/20220922123507.11222-1-shangxiaojing@huawei.com Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Diffstat (limited to 'drivers/vfio/pci/mlx5/main.c')
-rw-r--r--drivers/vfio/pci/mlx5/main.c13
1 files changed, 1 insertions, 12 deletions
diff --git a/drivers/vfio/pci/mlx5/main.c b/drivers/vfio/pci/mlx5/main.c
index fd6ccb8454a2..457138b92f13 100644
--- a/drivers/vfio/pci/mlx5/main.c
+++ b/drivers/vfio/pci/mlx5/main.c
@@ -676,18 +676,7 @@ static struct pci_driver mlx5vf_pci_driver = {
.driver_managed_dma = true,
};
-static void __exit mlx5vf_pci_cleanup(void)
-{
- pci_unregister_driver(&mlx5vf_pci_driver);
-}
-
-static int __init mlx5vf_pci_init(void)
-{
- return pci_register_driver(&mlx5vf_pci_driver);
-}
-
-module_init(mlx5vf_pci_init);
-module_exit(mlx5vf_pci_cleanup);
+module_pci_driver(mlx5vf_pci_driver);
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Max Gurtovoy <mgurtovoy@nvidia.com>");