* [PATCH -next] vfio/mlx5: Switch to use module_pci_driver() macro
@ 2022-09-22 12:35 Shang XiaoJing
2022-09-22 12:48 ` Jason Gunthorpe
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Shang XiaoJing @ 2022-09-22 12:35 UTC (permalink / raw)
To: yishaih, jgg, shameerali.kolothum.thodi, kevin.tian,
alex.williamson, cohuck, kvm
Cc: shangxiaojing
Since pci provides the helper macro module_pci_driver(), we may replace
the module_init/exit with it.
Signed-off-by: Shang XiaoJing <shangxiaojing@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 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@nvidia.com>");
--
2.17.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH -next] vfio/mlx5: Switch to use module_pci_driver() macro
2022-09-22 12:35 [PATCH -next] vfio/mlx5: Switch to use module_pci_driver() macro Shang XiaoJing
@ 2022-09-22 12:48 ` Jason Gunthorpe
2022-11-03 19:07 ` Alex Williamson
2022-11-10 20:16 ` Alex Williamson
2 siblings, 0 replies; 6+ messages in thread
From: Jason Gunthorpe @ 2022-09-22 12:48 UTC (permalink / raw)
To: Shang XiaoJing
Cc: yishaih, shameerali.kolothum.thodi, kevin.tian, alex.williamson,
cohuck, kvm
On Thu, Sep 22, 2022 at 08:35:07PM +0800, Shang XiaoJing 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@huawei.com>
> ---
> drivers/vfio/pci/mlx5/main.c | 13 +------------
> 1 file changed, 1 insertion(+), 12 deletions(-)
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Jason
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH -next] vfio/mlx5: Switch to use module_pci_driver() macro
2022-09-22 12:35 [PATCH -next] vfio/mlx5: Switch to use module_pci_driver() macro Shang XiaoJing
2022-09-22 12:48 ` Jason Gunthorpe
@ 2022-11-03 19:07 ` Alex Williamson
2022-11-03 22:19 ` Jason Gunthorpe
2022-11-06 11:17 ` Yishai Hadas
2022-11-10 20:16 ` Alex Williamson
2 siblings, 2 replies; 6+ messages in thread
From: Alex Williamson @ 2022-11-03 19:07 UTC (permalink / raw)
To: Shang XiaoJing
Cc: yishaih, jgg, shameerali.kolothum.thodi, kevin.tian, cohuck, kvm
On Thu, 22 Sep 2022 20:35:07 +0800
Shang XiaoJing <shangxiaojing@huawei.com> 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@huawei.com>
> ---
> drivers/vfio/pci/mlx5/main.c | 13 +------------
> 1 file changed, 1 insertion(+), 12 deletions(-)
Nice cleanup. Yishai? Thanks,
Alex
>
> 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@nvidia.com>");
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH -next] vfio/mlx5: Switch to use module_pci_driver() macro
2022-11-03 19:07 ` Alex Williamson
@ 2022-11-03 22:19 ` Jason Gunthorpe
2022-11-06 11:17 ` Yishai Hadas
1 sibling, 0 replies; 6+ messages in thread
From: Jason Gunthorpe @ 2022-11-03 22:19 UTC (permalink / raw)
To: Alex Williamson
Cc: Shang XiaoJing, yishaih, shameerali.kolothum.thodi, kevin.tian,
cohuck, kvm
On Thu, Nov 03, 2022 at 01:07:42PM -0600, Alex Williamson wrote:
> On Thu, 22 Sep 2022 20:35:07 +0800
> Shang XiaoJing <shangxiaojing@huawei.com> 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@huawei.com>
> > ---
> > drivers/vfio/pci/mlx5/main.c | 13 +------------
> > 1 file changed, 1 insertion(+), 12 deletions(-)
>
> Nice cleanup. Yishai? Thanks,
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Jason
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH -next] vfio/mlx5: Switch to use module_pci_driver() macro
2022-11-03 19:07 ` Alex Williamson
2022-11-03 22:19 ` Jason Gunthorpe
@ 2022-11-06 11:17 ` Yishai Hadas
1 sibling, 0 replies; 6+ messages in thread
From: Yishai Hadas @ 2022-11-06 11:17 UTC (permalink / raw)
To: Alex Williamson, Shang XiaoJing
Cc: jgg, shameerali.kolothum.thodi, kevin.tian, cohuck, kvm
On 03/11/2022 21:07, Alex Williamson wrote:
> On Thu, 22 Sep 2022 20:35:07 +0800
> Shang XiaoJing <shangxiaojing@huawei.com> 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@huawei.com>
>> ---
>> drivers/vfio/pci/mlx5/main.c | 13 +------------
>> 1 file changed, 1 insertion(+), 12 deletions(-)
> Nice cleanup. Yishai? Thanks,
Reviewed-by: Yishai Hadas <yishaih@nvidia.com>
>
> Alex
>
>> 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@nvidia.com>");
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH -next] vfio/mlx5: Switch to use module_pci_driver() macro
2022-09-22 12:35 [PATCH -next] vfio/mlx5: Switch to use module_pci_driver() macro Shang XiaoJing
2022-09-22 12:48 ` Jason Gunthorpe
2022-11-03 19:07 ` Alex Williamson
@ 2022-11-10 20:16 ` Alex Williamson
2 siblings, 0 replies; 6+ messages in thread
From: Alex Williamson @ 2022-11-10 20:16 UTC (permalink / raw)
To: Shang XiaoJing
Cc: yishaih, jgg, shameerali.kolothum.thodi, kevin.tian, cohuck, kvm
On Thu, 22 Sep 2022 20:35:07 +0800
Shang XiaoJing <shangxiaojing@huawei.com> 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@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 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@nvidia.com>");
Applied to vfio next branch for v6.2. Thanks,
Alex
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2022-11-10 20:18 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-22 12:35 [PATCH -next] vfio/mlx5: Switch to use module_pci_driver() macro Shang XiaoJing
2022-09-22 12:48 ` Jason Gunthorpe
2022-11-03 19:07 ` Alex Williamson
2022-11-03 22:19 ` Jason Gunthorpe
2022-11-06 11:17 ` Yishai Hadas
2022-11-10 20:16 ` Alex Williamson
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.