]> git.karo-electronics.de Git - linux-beck.git/commitdiff
net/wireless: use module_pci_driver
authorAxel Lin <axel.lin@gmail.com>
Sat, 14 Apr 2012 02:38:36 +0000 (10:38 +0800)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 16 Apr 2012 18:38:50 +0000 (14:38 -0400)
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>
13 files changed:
drivers/net/wireless/adm8211.c
drivers/net/wireless/ath/ath5k/pci.c
drivers/net/wireless/atmel_pci.c
drivers/net/wireless/hostap/hostap_pci.c
drivers/net/wireless/hostap/hostap_plx.c
drivers/net/wireless/mwl8k.c
drivers/net/wireless/p54/p54pci.c
drivers/net/wireless/rt2x00/rt2400pci.c
drivers/net/wireless/rt2x00/rt2500pci.c
drivers/net/wireless/rt2x00/rt61pci.c
drivers/net/wireless/rtl818x/rtl8180/dev.c
drivers/net/wireless/rtlwifi/rtl8192ce/sw.c
drivers/net/wireless/rtlwifi/rtl8192se/sw.c

index f5ce5623da990db9941699cae0bbba8ec74d238d..0ac09a2bd144049091e19ad9a56240cf62b7e64c 100644 (file)
@@ -1991,19 +1991,4 @@ static struct pci_driver adm8211_driver = {
 #endif /* CONFIG_PM */
 };
 
-
-
-static int __init adm8211_init(void)
-{
-       return pci_register_driver(&adm8211_driver);
-}
-
-
-static void __exit adm8211_exit(void)
-{
-       pci_unregister_driver(&adm8211_driver);
-}
-
-
-module_init(adm8211_init);
-module_exit(adm8211_exit);
+module_pci_driver(adm8211_driver);
index f8170fc9c72de01a2af65e052546e55c1a62d49a..dff48fbc63bfd1d7a4cc5aed6c2632c6128c77e9 100644 (file)
@@ -340,28 +340,4 @@ static struct pci_driver ath5k_pci_driver = {
        .driver.pm      = ATH5K_PM_OPS,
 };
 
-/*
- * Module init/exit functions
- */
-static int __init
-init_ath5k_pci(void)
-{
-       int ret;
-
-       ret = pci_register_driver(&ath5k_pci_driver);
-       if (ret) {
-               pr_err("pci: can't register pci driver\n");
-               return ret;
-       }
-
-       return 0;
-}
-
-static void __exit
-exit_ath5k_pci(void)
-{
-       pci_unregister_driver(&ath5k_pci_driver);
-}
-
-module_init(init_ath5k_pci);
-module_exit(exit_ath5k_pci);
+module_pci_driver(ath5k_pci_driver);
index 9ab1192004c038c92316238362a46d82b0093f3e..51e33b53386e58a3d85c180d271c1678b8b08a01 100644 (file)
@@ -74,15 +74,4 @@ static void __devexit atmel_pci_remove(struct pci_dev *pdev)
        stop_atmel_card(pci_get_drvdata(pdev));
 }
 
-static int __init atmel_init_module(void)
-{
-       return pci_register_driver(&atmel_driver);
-}
-
-static void __exit atmel_cleanup_module(void)
-{
-       pci_unregister_driver(&atmel_driver);
-}
-
-module_init(atmel_init_module);
-module_exit(atmel_cleanup_module);
+module_pci_driver(atmel_driver);
index 972a9c3af39e5e7ad11dafa354b5f7314083a985..05ca3402dca707d8cca9eb9f1d5432fdc44b3b7b 100644 (file)
@@ -457,18 +457,4 @@ static struct pci_driver prism2_pci_driver = {
 #endif /* CONFIG_PM */
 };
 
-
-static int __init init_prism2_pci(void)
-{
-       return pci_register_driver(&prism2_pci_driver);
-}
-
-
-static void __exit exit_prism2_pci(void)
-{
-       pci_unregister_driver(&prism2_pci_driver);
-}
-
-
-module_init(init_prism2_pci);
-module_exit(exit_prism2_pci);
+module_pci_driver(prism2_pci_driver);
index 33e79037770b38673e2e5c0fa18ec39a4619cba5..c3d067ee4db9cdbd2f34e3d5ede9461abe28f59c 100644 (file)
@@ -616,18 +616,4 @@ static struct pci_driver prism2_plx_driver = {
        .remove         = prism2_plx_remove,
 };
 
-
-static int __init init_prism2_plx(void)
-{
-       return pci_register_driver(&prism2_plx_driver);
-}
-
-
-static void __exit exit_prism2_plx(void)
-{
-       pci_unregister_driver(&prism2_plx_driver);
-}
-
-
-module_init(init_prism2_plx);
-module_exit(exit_prism2_plx);
+module_pci_driver(prism2_plx_driver);
index b48674b577e6938e34e10af87c447ec66195e065..e30cc32f82791a69a910ab79dfc8bc8541c60bab 100644 (file)
@@ -5893,18 +5893,7 @@ static struct pci_driver mwl8k_driver = {
        .shutdown       = __devexit_p(mwl8k_shutdown),
 };
 
-static int __init mwl8k_init(void)
-{
-       return pci_register_driver(&mwl8k_driver);
-}
-
-static void __exit mwl8k_exit(void)
-{
-       pci_unregister_driver(&mwl8k_driver);
-}
-
-module_init(mwl8k_init);
-module_exit(mwl8k_exit);
+module_pci_driver(mwl8k_driver);
 
 MODULE_DESCRIPTION(MWL8K_DESC);
 MODULE_VERSION(MWL8K_VERSION);
index 45df728183fdec6b4bd12017a154103d7069821f..89318adc8c7f0427ec8e95caed78a36312a934b8 100644 (file)
@@ -667,15 +667,4 @@ static struct pci_driver p54p_driver = {
        .driver.pm      = P54P_PM_OPS,
 };
 
-static int __init p54p_init(void)
-{
-       return pci_register_driver(&p54p_driver);
-}
-
-static void __exit p54p_exit(void)
-{
-       pci_unregister_driver(&p54p_driver);
-}
-
-module_init(p54p_init);
-module_exit(p54p_exit);
+module_pci_driver(p54p_driver);
index 3a6b40239bc1473a219921f11b0f5e50a72c7bf7..5e6b5014316591114884536de8c349e7a2ec0b4b 100644 (file)
@@ -1828,15 +1828,4 @@ static struct pci_driver rt2400pci_driver = {
        .resume         = rt2x00pci_resume,
 };
 
-static int __init rt2400pci_init(void)
-{
-       return pci_register_driver(&rt2400pci_driver);
-}
-
-static void __exit rt2400pci_exit(void)
-{
-       pci_unregister_driver(&rt2400pci_driver);
-}
-
-module_init(rt2400pci_init);
-module_exit(rt2400pci_exit);
+module_pci_driver(rt2400pci_driver);
index dcc0e1fcca77726e002ed490dc41aa640655830b..136b849f11b5c911d9d83285a139b68cc1133396 100644 (file)
@@ -2119,15 +2119,4 @@ static struct pci_driver rt2500pci_driver = {
        .resume         = rt2x00pci_resume,
 };
 
-static int __init rt2500pci_init(void)
-{
-       return pci_register_driver(&rt2500pci_driver);
-}
-
-static void __exit rt2500pci_exit(void)
-{
-       pci_unregister_driver(&rt2500pci_driver);
-}
-
-module_init(rt2500pci_init);
-module_exit(rt2500pci_exit);
+module_pci_driver(rt2500pci_driver);
index e0c6d117429d85c85439b76f41c72ead820cf906..ee22bd74579d7326373af68f6f3c0a4a879e3010 100644 (file)
@@ -3092,15 +3092,4 @@ static struct pci_driver rt61pci_driver = {
        .resume         = rt2x00pci_resume,
 };
 
-static int __init rt61pci_init(void)
-{
-       return pci_register_driver(&rt61pci_driver);
-}
-
-static void __exit rt61pci_exit(void)
-{
-       pci_unregister_driver(&rt61pci_driver);
-}
-
-module_init(rt61pci_init);
-module_exit(rt61pci_exit);
+module_pci_driver(rt61pci_driver);
index 2f14a5fb0cbb97007880b4cbf76fba2449500ac1..2bebcb71a1e946c122f26ceb293f306904256ac9 100644 (file)
@@ -1173,15 +1173,4 @@ static struct pci_driver rtl8180_driver = {
 #endif /* CONFIG_PM */
 };
 
-static int __init rtl8180_init(void)
-{
-       return pci_register_driver(&rtl8180_driver);
-}
-
-static void __exit rtl8180_exit(void)
-{
-       pci_unregister_driver(&rtl8180_driver);
-}
-
-module_init(rtl8180_init);
-module_exit(rtl8180_exit);
+module_pci_driver(rtl8180_driver);
index 2c3b73366cd2e2928423c1f600d7106966bd34c4..3aa927f8b9b93bfbf0b12d9d0194966cd24900c8 100644 (file)
@@ -389,21 +389,4 @@ static struct pci_driver rtl92ce_driver = {
        .driver.pm = &rtlwifi_pm_ops,
 };
 
-static int __init rtl92ce_module_init(void)
-{
-       int ret;
-
-       ret = pci_register_driver(&rtl92ce_driver);
-       if (ret)
-               RT_ASSERT(false, "No device found\n");
-
-       return ret;
-}
-
-static void __exit rtl92ce_module_exit(void)
-{
-       pci_unregister_driver(&rtl92ce_driver);
-}
-
-module_init(rtl92ce_module_init);
-module_exit(rtl92ce_module_exit);
+module_pci_driver(rtl92ce_driver);
index f1b36005c6a2c9496bdce302e17571a144cf2393..730bcc91952948160a0b50976b90f75e7c6bcc11 100644 (file)
@@ -450,21 +450,4 @@ static struct pci_driver rtl92se_driver = {
        .driver.pm = &rtlwifi_pm_ops,
 };
 
-static int __init rtl92se_module_init(void)
-{
-       int ret = 0;
-
-       ret = pci_register_driver(&rtl92se_driver);
-       if (ret)
-               RT_ASSERT(false, "No device found\n");
-
-       return ret;
-}
-
-static void __exit rtl92se_module_exit(void)
-{
-       pci_unregister_driver(&rtl92se_driver);
-}
-
-module_init(rtl92se_module_init);
-module_exit(rtl92se_module_exit);
+module_pci_driver(rtl92se_driver);