Commit cd48ebc5 authored by Shang XiaoJing's avatar Shang XiaoJing Committed by Alex Williamson

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: default avatarShang XiaoJing <shangxiaojing@huawei.com>
Reviewed-by: default avatarYishai Hadas <yishaih@nvidia.com>
Reviewed-by: default avatarJason Gunthorpe <jgg@nvidia.com>
Link: https://lore.kernel.org/r/20220922123507.11222-1-shangxiaojing@huawei.comSigned-off-by: default avatarAlex Williamson <alex.williamson@redhat.com>
parent a39a1466
......@@ -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>");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment