aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@gmail.com>2012-04-13 22:38:36 -0400
committerJohn W. Linville <linville@tuxdriver.com>2012-04-16 14:38:50 -0400
commit5b0a3b7eb37730c369cc47783549dcf6f54a1cd0 (patch)
treeb9b157758319921a6cb6dbcc5731387b8b2006d6
parent1dae27f84baa37b76014b348985089d22d90cccc (diff)
net/wireless: use module_pci_driver
This patch converts the drivers in drivers/net/wireless/* to use module_pci_driver() macro which makes the code smaller and a bit simpler. Signed-off-by: Axel Lin <axel.lin@gmail.com> Cc: "John W. Linville" <linville@tuxdriver.com> Cc: Jiri Slaby <jirislaby@gmail.com> Cc: Nick Kossifidis <mickflemm@gmail.com> Cc: "Luis R. Rodriguez" <mcgrof@qca.qualcomm.com> Cc: Simon Kelley <simon@thekelleys.org.uk> Cc: Jouni Malinen <j@w1.fi> Cc: Lennert Buytenhek <buytenh@wantstofly.org> Cc: Christian Lamparter <chunkeey@googlemail.com> Cc: Ivo van Doorn <IvDoorn@gmail.com> Cc: Larry Finger <Larry.Finger@lwfinger.net> Cc: linux-wireless@vger.kernel.org Acked-by: Lennert Buytenhek <buytenh@wantstofly.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/adm8211.c17
-rw-r--r--drivers/net/wireless/ath/ath5k/pci.c26
-rw-r--r--drivers/net/wireless/atmel_pci.c13
-rw-r--r--drivers/net/wireless/hostap/hostap_pci.c16
-rw-r--r--drivers/net/wireless/hostap/hostap_plx.c16
-rw-r--r--drivers/net/wireless/mwl8k.c13
-rw-r--r--drivers/net/wireless/p54/p54pci.c13
-rw-r--r--drivers/net/wireless/rt2x00/rt2400pci.c13
-rw-r--r--drivers/net/wireless/rt2x00/rt2500pci.c13
-rw-r--r--drivers/net/wireless/rt2x00/rt61pci.c13
-rw-r--r--drivers/net/wireless/rtl818x/rtl8180/dev.c13
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192ce/sw.c19
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192se/sw.c19
13 files changed, 13 insertions, 191 deletions
diff --git a/drivers/net/wireless/adm8211.c b/drivers/net/wireless/adm8211.c
index f5ce5623da99..0ac09a2bd144 100644
--- a/drivers/net/wireless/adm8211.c
+++ b/drivers/net/wireless/adm8211.c
@@ -1991,19 +1991,4 @@ static struct pci_driver adm8211_driver = {
1991#endif /* CONFIG_PM */ 1991#endif /* CONFIG_PM */
1992}; 1992};
1993 1993
1994 1994module_pci_driver(adm8211_driver);
1995
1996static int __init adm8211_init(void)
1997{
1998 return pci_register_driver(&adm8211_driver);
1999}
2000
2001
2002static void __exit adm8211_exit(void)
2003{
2004 pci_unregister_driver(&adm8211_driver);
2005}
2006
2007
2008module_init(adm8211_init);
2009module_exit(adm8211_exit);
diff --git a/drivers/net/wireless/ath/ath5k/pci.c b/drivers/net/wireless/ath/ath5k/pci.c
index f8170fc9c72d..dff48fbc63bf 100644
--- a/drivers/net/wireless/ath/ath5k/pci.c
+++ b/drivers/net/wireless/ath/ath5k/pci.c
@@ -340,28 +340,4 @@ static struct pci_driver ath5k_pci_driver = {
340 .driver.pm = ATH5K_PM_OPS, 340 .driver.pm = ATH5K_PM_OPS,
341}; 341};
342 342
343/* 343module_pci_driver(ath5k_pci_driver);
344 * Module init/exit functions
345 */
346static int __init
347init_ath5k_pci(void)
348{
349 int ret;
350
351 ret = pci_register_driver(&ath5k_pci_driver);
352 if (ret) {
353 pr_err("pci: can't register pci driver\n");
354 return ret;
355 }
356
357 return 0;
358}
359
360static void __exit
361exit_ath5k_pci(void)
362{
363 pci_unregister_driver(&ath5k_pci_driver);
364}
365
366module_init(init_ath5k_pci);
367module_exit(exit_ath5k_pci);
diff --git a/drivers/net/wireless/atmel_pci.c b/drivers/net/wireless/atmel_pci.c
index 9ab1192004c0..51e33b53386e 100644
--- a/drivers/net/wireless/atmel_pci.c
+++ b/drivers/net/wireless/atmel_pci.c
@@ -74,15 +74,4 @@ static void __devexit atmel_pci_remove(struct pci_dev *pdev)
74 stop_atmel_card(pci_get_drvdata(pdev)); 74 stop_atmel_card(pci_get_drvdata(pdev));
75} 75}
76 76
77static int __init atmel_init_module(void) 77module_pci_driver(atmel_driver);
78{
79 return pci_register_driver(&atmel_driver);
80}
81
82static void __exit atmel_cleanup_module(void)
83{
84 pci_unregister_driver(&atmel_driver);
85}
86
87module_init(atmel_init_module);
88module_exit(atmel_cleanup_module);
diff --git a/drivers/net/wireless/hostap/hostap_pci.c b/drivers/net/wireless/hostap/hostap_pci.c
index 972a9c3af39e..05ca3402dca7 100644
--- a/drivers/net/wireless/hostap/hostap_pci.c
+++ b/drivers/net/wireless/hostap/hostap_pci.c
@@ -457,18 +457,4 @@ static struct pci_driver prism2_pci_driver = {
457#endif /* CONFIG_PM */ 457#endif /* CONFIG_PM */
458}; 458};
459 459
460 460module_pci_driver(prism2_pci_driver);
461static int __init init_prism2_pci(void)
462{
463 return pci_register_driver(&prism2_pci_driver);
464}
465
466
467static void __exit exit_prism2_pci(void)
468{
469 pci_unregister_driver(&prism2_pci_driver);
470}
471
472
473module_init(init_prism2_pci);
474module_exit(exit_prism2_pci);
diff --git a/drivers/net/wireless/hostap/hostap_plx.c b/drivers/net/wireless/hostap/hostap_plx.c
index 33e79037770b..c3d067ee4db9 100644
--- a/drivers/net/wireless/hostap/hostap_plx.c
+++ b/drivers/net/wireless/hostap/hostap_plx.c
@@ -616,18 +616,4 @@ static struct pci_driver prism2_plx_driver = {
616 .remove = prism2_plx_remove, 616 .remove = prism2_plx_remove,
617}; 617};
618 618
619 619module_pci_driver(prism2_plx_driver);
620static int __init init_prism2_plx(void)
621{
622 return pci_register_driver(&prism2_plx_driver);
623}
624
625
626static void __exit exit_prism2_plx(void)
627{
628 pci_unregister_driver(&prism2_plx_driver);
629}
630
631
632module_init(init_prism2_plx);
633module_exit(exit_prism2_plx);
diff --git a/drivers/net/wireless/mwl8k.c b/drivers/net/wireless/mwl8k.c
index b48674b577e6..e30cc32f8279 100644
--- a/drivers/net/wireless/mwl8k.c
+++ b/drivers/net/wireless/mwl8k.c
@@ -5893,18 +5893,7 @@ static struct pci_driver mwl8k_driver = {
5893 .shutdown = __devexit_p(mwl8k_shutdown), 5893 .shutdown = __devexit_p(mwl8k_shutdown),
5894}; 5894};
5895 5895
5896static int __init mwl8k_init(void) 5896module_pci_driver(mwl8k_driver);
5897{
5898 return pci_register_driver(&mwl8k_driver);
5899}
5900
5901static void __exit mwl8k_exit(void)
5902{
5903 pci_unregister_driver(&mwl8k_driver);
5904}
5905
5906module_init(mwl8k_init);
5907module_exit(mwl8k_exit);
5908 5897
5909MODULE_DESCRIPTION(MWL8K_DESC); 5898MODULE_DESCRIPTION(MWL8K_DESC);
5910MODULE_VERSION(MWL8K_VERSION); 5899MODULE_VERSION(MWL8K_VERSION);
diff --git a/drivers/net/wireless/p54/p54pci.c b/drivers/net/wireless/p54/p54pci.c
index 45df728183fd..89318adc8c7f 100644
--- a/drivers/net/wireless/p54/p54pci.c
+++ b/drivers/net/wireless/p54/p54pci.c
@@ -667,15 +667,4 @@ static struct pci_driver p54p_driver = {
667 .driver.pm = P54P_PM_OPS, 667 .driver.pm = P54P_PM_OPS,
668}; 668};
669 669
670static int __init p54p_init(void) 670module_pci_driver(p54p_driver);
671{
672 return pci_register_driver(&p54p_driver);
673}
674
675static void __exit p54p_exit(void)
676{
677 pci_unregister_driver(&p54p_driver);
678}
679
680module_init(p54p_init);
681module_exit(p54p_exit);
diff --git a/drivers/net/wireless/rt2x00/rt2400pci.c b/drivers/net/wireless/rt2x00/rt2400pci.c
index 3a6b40239bc1..5e6b50143165 100644
--- a/drivers/net/wireless/rt2x00/rt2400pci.c
+++ b/drivers/net/wireless/rt2x00/rt2400pci.c
@@ -1828,15 +1828,4 @@ static struct pci_driver rt2400pci_driver = {
1828 .resume = rt2x00pci_resume, 1828 .resume = rt2x00pci_resume,
1829}; 1829};
1830 1830
1831static int __init rt2400pci_init(void) 1831module_pci_driver(rt2400pci_driver);
1832{
1833 return pci_register_driver(&rt2400pci_driver);
1834}
1835
1836static void __exit rt2400pci_exit(void)
1837{
1838 pci_unregister_driver(&rt2400pci_driver);
1839}
1840
1841module_init(rt2400pci_init);
1842module_exit(rt2400pci_exit);
diff --git a/drivers/net/wireless/rt2x00/rt2500pci.c b/drivers/net/wireless/rt2x00/rt2500pci.c
index dcc0e1fcca77..136b849f11b5 100644
--- a/drivers/net/wireless/rt2x00/rt2500pci.c
+++ b/drivers/net/wireless/rt2x00/rt2500pci.c
@@ -2119,15 +2119,4 @@ static struct pci_driver rt2500pci_driver = {
2119 .resume = rt2x00pci_resume, 2119 .resume = rt2x00pci_resume,
2120}; 2120};
2121 2121
2122static int __init rt2500pci_init(void) 2122module_pci_driver(rt2500pci_driver);
2123{
2124 return pci_register_driver(&rt2500pci_driver);
2125}
2126
2127static void __exit rt2500pci_exit(void)
2128{
2129 pci_unregister_driver(&rt2500pci_driver);
2130}
2131
2132module_init(rt2500pci_init);
2133module_exit(rt2500pci_exit);
diff --git a/drivers/net/wireless/rt2x00/rt61pci.c b/drivers/net/wireless/rt2x00/rt61pci.c
index e0c6d117429d..ee22bd74579d 100644
--- a/drivers/net/wireless/rt2x00/rt61pci.c
+++ b/drivers/net/wireless/rt2x00/rt61pci.c
@@ -3092,15 +3092,4 @@ static struct pci_driver rt61pci_driver = {
3092 .resume = rt2x00pci_resume, 3092 .resume = rt2x00pci_resume,
3093}; 3093};
3094 3094
3095static int __init rt61pci_init(void) 3095module_pci_driver(rt61pci_driver);
3096{
3097 return pci_register_driver(&rt61pci_driver);
3098}
3099
3100static void __exit rt61pci_exit(void)
3101{
3102 pci_unregister_driver(&rt61pci_driver);
3103}
3104
3105module_init(rt61pci_init);
3106module_exit(rt61pci_exit);
diff --git a/drivers/net/wireless/rtl818x/rtl8180/dev.c b/drivers/net/wireless/rtl818x/rtl8180/dev.c
index 2f14a5fb0cbb..2bebcb71a1e9 100644
--- a/drivers/net/wireless/rtl818x/rtl8180/dev.c
+++ b/drivers/net/wireless/rtl818x/rtl8180/dev.c
@@ -1173,15 +1173,4 @@ static struct pci_driver rtl8180_driver = {
1173#endif /* CONFIG_PM */ 1173#endif /* CONFIG_PM */
1174}; 1174};
1175 1175
1176static int __init rtl8180_init(void) 1176module_pci_driver(rtl8180_driver);
1177{
1178 return pci_register_driver(&rtl8180_driver);
1179}
1180
1181static void __exit rtl8180_exit(void)
1182{
1183 pci_unregister_driver(&rtl8180_driver);
1184}
1185
1186module_init(rtl8180_init);
1187module_exit(rtl8180_exit);
diff --git a/drivers/net/wireless/rtlwifi/rtl8192ce/sw.c b/drivers/net/wireless/rtlwifi/rtl8192ce/sw.c
index 2c3b73366cd2..3aa927f8b9b9 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192ce/sw.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192ce/sw.c
@@ -389,21 +389,4 @@ static struct pci_driver rtl92ce_driver = {
389 .driver.pm = &rtlwifi_pm_ops, 389 .driver.pm = &rtlwifi_pm_ops,
390}; 390};
391 391
392static int __init rtl92ce_module_init(void) 392module_pci_driver(rtl92ce_driver);
393{
394 int ret;
395
396 ret = pci_register_driver(&rtl92ce_driver);
397 if (ret)
398 RT_ASSERT(false, "No device found\n");
399
400 return ret;
401}
402
403static void __exit rtl92ce_module_exit(void)
404{
405 pci_unregister_driver(&rtl92ce_driver);
406}
407
408module_init(rtl92ce_module_init);
409module_exit(rtl92ce_module_exit);
diff --git a/drivers/net/wireless/rtlwifi/rtl8192se/sw.c b/drivers/net/wireless/rtlwifi/rtl8192se/sw.c
index f1b36005c6a2..730bcc919529 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192se/sw.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192se/sw.c
@@ -450,21 +450,4 @@ static struct pci_driver rtl92se_driver = {
450 .driver.pm = &rtlwifi_pm_ops, 450 .driver.pm = &rtlwifi_pm_ops,
451}; 451};
452 452
453static int __init rtl92se_module_init(void) 453module_pci_driver(rtl92se_driver);
454{
455 int ret = 0;
456
457 ret = pci_register_driver(&rtl92se_driver);
458 if (ret)
459 RT_ASSERT(false, "No device found\n");
460
461 return ret;
462}
463
464static void __exit rtl92se_module_exit(void)
465{
466 pci_unregister_driver(&rtl92se_driver);
467}
468
469module_init(rtl92se_module_init);
470module_exit(rtl92se_module_exit);