All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next] vfio/mlx5: use module_pci_driver
@ 2022-11-09  9:37 ruanjinjie
  2022-11-09 13:47 ` Shameerali Kolothum Thodi
  0 siblings, 1 reply; 3+ messages in thread
From: ruanjinjie @ 2022-11-09  9:37 UTC (permalink / raw)
  To: jgg, yishaih, shameerali.kolothum.thodi, kevin.tian,
	alex.williamson, cohuck, kvm, linux-kernel
  Cc: ruanjinjie

mlx5vf_pci_init and mlx5vf_pci_cleanup with module_init and module_exit
calls can be replaced with the module_pci_driver call, as they are similar
to what module_pci_driver does

Signed-off-by: ruanjinjie <ruanjinjie@huawei.com>
---
 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 fd6ccb8454a2..457138b92f13 100644
--- a/drivers/vfio/pci/mlx5/main.c
+++ b/drivers/vfio/pci/mlx5/main.c
@@ -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>");
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* RE: [PATCH -next] vfio/mlx5: use module_pci_driver
  2022-11-09  9:37 [PATCH -next] vfio/mlx5: use module_pci_driver ruanjinjie
@ 2022-11-09 13:47 ` Shameerali Kolothum Thodi
  0 siblings, 0 replies; 3+ messages in thread
From: Shameerali Kolothum Thodi @ 2022-11-09 13:47 UTC (permalink / raw)
  To: ruanjinjie, jgg, yishaih, kevin.tian, alex.williamson, cohuck,
	kvm, linux-kernel



> -----Original Message-----
> From: ruanjinjie
> Sent: 09 November 2022 09:37
> To: jgg@ziepe.ca; yishaih@nvidia.com; Shameerali Kolothum Thodi
> <shameerali.kolothum.thodi@huawei.com>; kevin.tian@intel.com;
> alex.williamson@redhat.com; cohuck@redhat.com; kvm@vger.kernel.org;
> linux-kernel@vger.kernel.org
> Cc: ruanjinjie <ruanjinjie@huawei.com>
> Subject: [PATCH -next] vfio/mlx5: use module_pci_driver
> 
> mlx5vf_pci_init and mlx5vf_pci_cleanup with module_init and module_exit
> calls can be replaced with the module_pci_driver call, as they are similar
> to what module_pci_driver does

There is already a patch out there,
https://lore.kernel.org/kvm/20220922123507.11222-1-shangxiaojing@huawei.com/

Thanks,
Shameer

> Signed-off-by: ruanjinjie <ruanjinjie@huawei.com>
> ---
>  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 fd6ccb8454a2..457138b92f13 100644
> --- a/drivers/vfio/pci/mlx5/main.c
> +++ b/drivers/vfio/pci/mlx5/main.c
> @@ -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>");
> --
> 2.25.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH -next] vfio/mlx5: use module_pci_driver
@ 2022-11-09  8:57 ruanjinjie
  0 siblings, 0 replies; 3+ messages in thread
From: ruanjinjie @ 2022-11-09  8:57 UTC (permalink / raw)
  To: jgg, yishaih, shameerali.kolothum.thodi, kevin.tian,
	alex.williamson, cohuck, kvm, linux-kernel
  Cc: ruanjinjie

mlx5vf_pci_init and mlx5vf_pci_cleanup with module_init and module_exit
calls can be replaced with the module_pci_driver call, as they are similar
to what module_pci_driver does

Signed-off-by: ruanjinjie <ruanjinjie@huawei.com>
---
 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 fd6ccb8454a2..457138b92f13 100644
--- a/drivers/vfio/pci/mlx5/main.c
+++ b/drivers/vfio/pci/mlx5/main.c
@@ -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>");
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-11-09 13:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-09  9:37 [PATCH -next] vfio/mlx5: use module_pci_driver ruanjinjie
2022-11-09 13:47 ` Shameerali Kolothum Thodi
  -- strict thread matches above, loose matches on Subject: below --
2022-11-09  8:57 ruanjinjie

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.