Skip to content

Commit

Permalink
vfio/mlx5: Switch to use module_pci_driver() macro
Browse files Browse the repository at this point in the history
Since pci provides the helper macro module_pci_driver(), we may replace
the module_init/exit with it.

Signed-off-by: Shang XiaoJing <[email protected]>
Reviewed-by: Yishai Hadas <[email protected]>
Reviewed-by: Jason Gunthorpe <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alex Williamson <[email protected]>
  • Loading branch information
Shang XiaoJing authored and awilliam committed Nov 9, 2022
1 parent a39a146 commit cd48ebc
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions drivers/vfio/pci/mlx5/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 <[email protected]>");
Expand Down

0 comments on commit cd48ebc

Please sign in to comment.