vfio/mlx5: Switch to use module_pci_driver() macro
Subsystems (4)
PATCH 1/1 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.
--- drivers/vfio/pci/mlx5/main.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-)
drivers/vfio/pci/mlx5/main.c +1 -12
@@ -654,18 +654,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]>" );
Signature · 1 line
2.17.1
Quoted 7 lines · Shang XiaoJing
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]>--- drivers/vfio/pci/mlx5/main.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-)
Jason
Quoted 7 lines · On Thu, 22 Sep 2022 20:35:07 +0800 Shang XiaoJing <[email protected]>…
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]>--- drivers/vfio/pci/mlx5/main.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-)
Nice cleanup. Yishai? Thanks,
Alex
Quoted 25 lines
drivers/vfio/pci/mlx5/main.c +1
-12@@ -654,18 +654,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]>" );
Jason Gunthorpe
Reviewed-byQuoted 6 lines · Alex Williamson
Quoted 3 lines · On Thu, 22 Sep 2022 20:35:07 +0800 Shang XiaoJing <[email protected]>…
Since pci provides the helper macro
module_pci_driver(), we may replace the module_init/exit with it.
Quoted 6 lines
Quoted 4 lines
Signed-off-by Shang XiaoJing <[email protected]>--- drivers/vfio/pci/mlx5/main.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-)Nice cleanup. Yishai? Thanks,
Jason
Quoted 11 lines · Alex Williamson
Quoted 7 lines · On Thu, 22 Sep 2022 20:35:07 +0800 Shang XiaoJing <[email protected]>…
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]>--- drivers/vfio/pci/mlx5/main.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-)Nice cleanup. Yishai? Thanks,
Quoted 27 lines
Alex
Quoted 24 lines
drivers/vfio/pci/mlx5/main.c +1
-12@@ -654,18 +654,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]>" );
Alex Williamson
AppliedQuoted 22 lines · On Thu, 22 Sep 2022 20:35:07 +0800 Shang XiaoJing <[email protected]>…
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]>--- drivers/vfio/pci/mlx5/main.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-)drivers/vfio/pci/mlx5/main.c +0
-6@@ -654,18 +654,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 )
drivers/vfio/pci/mlx5/main.c static struct pci_driver mlx5vf_pci_driver = { · line 660
Quoted 10 lines
drivers/vfio/pci/mlx5/main.c +1
-6-{ -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]>" );
Applied to vfio next branch for v6.2. Thanks,
Alex