* [PATCH -next] IB/mlx5: use module_pci_driver to simplify the code
@ 2013-07-17 1:56 Wei Yongjun
[not found] ` <CAPgLHd917tqPE=CBP0OezF=v+M61GY=cUX-GTUbUKYhoeoj3hQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
0 siblings, 1 reply; 2+ messages in thread
From: Wei Yongjun @ 2013-07-17 1:56 UTC (permalink / raw)
To: eli-VPRAkNaXOzVWk0Htik3J/w, roland-DgEjT+Ai2ygdnm+yROfE0A,
sean.hefty-ral2JQCrhuEAvxtiuMwx3w,
hal.rosenstock-Re5JQEeQqe8AvxtiuMwx3w
Cc: yongjun_wei-zrsr2BFq86L20UzCJQGyNP8+0UxHXcjY,
linux-rdma-u79uwXL29TY76Z2rM5mHXA
From: Wei Yongjun <yongjun_wei-zrsr2BFq86L20UzCJQGyNP8+0UxHXcjY@public.gmane.org>
Use the module_pci_driver() macro to make the code simpler
by eliminating module_init and module_exit calls.
Signed-off-by: Wei Yongjun <yongjun_wei-zrsr2BFq86L20UzCJQGyNP8+0UxHXcjY@public.gmane.org>
---
drivers/infiniband/hw/mlx5/main.c | 13 +------------
1 file changed, 1 insertion(+), 12 deletions(-)
diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c
index 8000fff..0cdc185 100644
--- a/drivers/infiniband/hw/mlx5/main.c
+++ b/drivers/infiniband/hw/mlx5/main.c
@@ -1490,15 +1490,4 @@ static struct pci_driver mlx5_ib_driver = {
.remove = remove_one
};
-static int __init mlx5_ib_init(void)
-{
- return pci_register_driver(&mlx5_ib_driver);
-}
-
-static void __exit mlx5_ib_cleanup(void)
-{
- pci_unregister_driver(&mlx5_ib_driver);
-}
-
-module_init(mlx5_ib_init);
-module_exit(mlx5_ib_cleanup);
+module_pci_driver(mlx5_ib_driver);
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH -next] IB/mlx5: use module_pci_driver to simplify the code
[not found] ` <CAPgLHd917tqPE=CBP0OezF=v+M61GY=cUX-GTUbUKYhoeoj3hQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2013-07-17 15:54 ` Eli Cohen
0 siblings, 0 replies; 2+ messages in thread
From: Eli Cohen @ 2013-07-17 15:54 UTC (permalink / raw)
To: Wei Yongjun
Cc: eli-VPRAkNaXOzVWk0Htik3J/w, roland-DgEjT+Ai2ygdnm+yROfE0A,
sean.hefty-ral2JQCrhuEAvxtiuMwx3w,
hal.rosenstock-Re5JQEeQqe8AvxtiuMwx3w,
yongjun_wei-zrsr2BFq86L20UzCJQGyNP8+0UxHXcjY,
linux-rdma-u79uwXL29TY76Z2rM5mHXA
Looks to me like a convenience that we may need to give up later
should we need to put any code in the init or cleanup functions.
On Wed, Jul 17, 2013 at 09:56:41AM +0800, Wei Yongjun wrote:
> From: Wei Yongjun <yongjun_wei-zrsr2BFq86L20UzCJQGyNP8+0UxHXcjY@public.gmane.org>
>
> Use the module_pci_driver() macro to make the code simpler
> by eliminating module_init and module_exit calls.
>
> Signed-off-by: Wei Yongjun <yongjun_wei-zrsr2BFq86L20UzCJQGyNP8+0UxHXcjY@public.gmane.org>
> ---
> drivers/infiniband/hw/mlx5/main.c | 13 +------------
> 1 file changed, 1 insertion(+), 12 deletions(-)
>
> diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c
> index 8000fff..0cdc185 100644
> --- a/drivers/infiniband/hw/mlx5/main.c
> +++ b/drivers/infiniband/hw/mlx5/main.c
> @@ -1490,15 +1490,4 @@ static struct pci_driver mlx5_ib_driver = {
> .remove = remove_one
> };
>
> -static int __init mlx5_ib_init(void)
> -{
> - return pci_register_driver(&mlx5_ib_driver);
> -}
> -
> -static void __exit mlx5_ib_cleanup(void)
> -{
> - pci_unregister_driver(&mlx5_ib_driver);
> -}
> -
> -module_init(mlx5_ib_init);
> -module_exit(mlx5_ib_cleanup);
> +module_pci_driver(mlx5_ib_driver);
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-07-17 15:54 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-17 1:56 [PATCH -next] IB/mlx5: use module_pci_driver to simplify the code Wei Yongjun
[not found] ` <CAPgLHd917tqPE=CBP0OezF=v+M61GY=cUX-GTUbUKYhoeoj3hQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-07-17 15:54 ` Eli Cohen
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.