Patchwork atm: he: use module_pci_driver to simplify the code

login
register
mail settings
Submitter Wei Yongjun
Date Oct. 10, 2012, 1 p.m.
Message ID <CAPgLHd-aYakavX_RRdiF3Sy1kjpUWWgHe0pqkpmGt6O8oi75jg@mail.gmail.com>
Download mbox | patch
Permalink /patch/190635/
State Deferred
Delegated to: David Miller
Headers show

Comments

Wei Yongjun - Oct. 10, 2012, 1 p.m.
From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

Use the module_pci_driver() macro to make the code simpler
by eliminating module_init and module_exit calls.

dpatch engine is used to auto generate this patch.
(https://github.com/weiyj/dpatch)

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
---
 drivers/atm/he.c | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)



--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/drivers/atm/he.c b/drivers/atm/he.c
index b182c2f..e184339 100644
--- a/drivers/atm/he.c
+++ b/drivers/atm/he.c
@@ -2883,15 +2883,4 @@  static struct pci_driver he_driver = {
 	.id_table =	he_pci_tbl,
 };
 
-static int __init he_init(void)
-{
-	return pci_register_driver(&he_driver);
-}
-
-static void __exit he_cleanup(void)
-{
-	pci_unregister_driver(&he_driver);
-}
-
-module_init(he_init);
-module_exit(he_cleanup);
+module_pci_driver(he_driver);