Skip to content

Commit cd48ebc

Browse files
Shang XiaoJingAlex Williamson
authored andcommitted
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 <[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]>
1 parent a39a146 commit cd48ebc

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

drivers/vfio/pci/mlx5/main.c

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -676,18 +676,7 @@ static struct pci_driver mlx5vf_pci_driver = {
676676
.driver_managed_dma = true,
677677
};
678678

679-
static void __exit mlx5vf_pci_cleanup(void)
680-
{
681-
pci_unregister_driver(&mlx5vf_pci_driver);
682-
}
683-
684-
static int __init mlx5vf_pci_init(void)
685-
{
686-
return pci_register_driver(&mlx5vf_pci_driver);
687-
}
688-
689-
module_init(mlx5vf_pci_init);
690-
module_exit(mlx5vf_pci_cleanup);
679+
module_pci_driver(mlx5vf_pci_driver);
691680

692681
MODULE_LICENSE("GPL");
693682
MODULE_AUTHOR("Max Gurtovoy <[email protected]>");

0 commit comments

Comments
 (0)