Re: [PATCH -next] vfio/mlx5: Switch to use module_pci_driver() macro

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 22 Sep 2022 20:35:07 +0800
Shang XiaoJing <shangxiaojing@xxxxxxxxxx> wrote:

> Since pci provides the helper macro module_pci_driver(), we may replace
> the module_init/exit with it.
> 
> Signed-off-by: Shang XiaoJing <shangxiaojing@xxxxxxxxxx>
> ---
>  drivers/vfio/pci/mlx5/main.c | 13 +------------
>  1 file changed, 1 insertion(+), 12 deletions(-)
> 
> diff --git a/drivers/vfio/pci/mlx5/main.c b/drivers/vfio/pci/mlx5/main.c
> index 759a5f5f7b3f..42bfa2678b81 100644
> --- a/drivers/vfio/pci/mlx5/main.c
> +++ b/drivers/vfio/pci/mlx5/main.c
> @@ -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 <mgurtovoy@xxxxxxxxxx>");

Applied to vfio next branch for v6.2.  Thanks,

Alex




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux