brcm80211: fmac: move module init/exit to sdio layer
authorFranky Lin <frankyl@broadcom.com>
Wed, 23 Nov 2011 01:21:47 +0000 (17:21 -0800)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 28 Nov 2011 19:43:36 +0000 (14:43 -0500)
This patch is part of the fullmac bus interface refactoring series.
It moves the module init/exit code to bus layer.

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Alwin Beukers <alwin@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/brcm80211/brcmfmac/bcmsdh_sdmmc.c
drivers/net/wireless/brcm80211/brcmfmac/dhd_bus.h
drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c

index adee3057d33096db860cb956c0bbe855cf756f1f..7a2325b2a564502a29b541476d5a89f25ab2c141 100644 (file)
@@ -577,17 +577,26 @@ static struct sdio_driver brcmf_sdmmc_driver = {
 #endif /* CONFIG_PM_SLEEP */
 };
 
-/* bus register interface */
-int brcmf_bus_register(void)
+static void __exit brcmf_sdio_exit(void)
 {
        brcmf_dbg(TRACE, "Enter\n");
 
-       return sdio_register_driver(&brcmf_sdmmc_driver);
+       sdio_unregister_driver(&brcmf_sdmmc_driver);
 }
 
-void brcmf_bus_unregister(void)
+static int __init brcmf_sdio_init(void)
 {
+       int ret;
+
        brcmf_dbg(TRACE, "Enter\n");
 
-       sdio_unregister_driver(&brcmf_sdmmc_driver);
+       ret = sdio_register_driver(&brcmf_sdmmc_driver);
+
+       if (ret)
+               brcmf_dbg(ERROR, "sdio_register_driver failed: %d\n", ret);
+
+       return ret;
 }
+
+module_init(brcmf_sdio_init);
+module_exit(brcmf_sdio_exit);
index a249407c9a1b8d4536d41a056fccbe51a4589e6b..118216b1ee2996198f3750168b1e4978f34f6239 100644 (file)
  * Exported from brcmf bus module (brcmf_usb, brcmf_sdio)
  */
 
-/* Indicate (dis)interest in finding dongles. */
-extern int brcmf_bus_register(void);
-extern void brcmf_bus_unregister(void);
-
 /* obtain linux device object providing bus function */
 extern struct device *brcmf_bus_get_device(struct brcmf_bus *bus);
 
index 62413e861784aa1751b704d1d76dc55a4d0e1c2a..73d328027e19785b163fe8cd3e384cf66f316ffc 100644 (file)
@@ -1147,34 +1147,6 @@ void brcmf_detach(struct brcmf_pub *drvr)
        }
 }
 
-static void __exit brcmf_module_cleanup(void)
-{
-       brcmf_dbg(TRACE, "Enter\n");
-
-       brcmf_bus_unregister();
-}
-
-static int __init brcmf_module_init(void)
-{
-       int error;
-
-       brcmf_dbg(TRACE, "Enter\n");
-
-       error = brcmf_bus_register();
-
-       if (error) {
-               brcmf_dbg(ERROR, "brcmf_bus_register failed\n");
-               goto failed;
-       }
-       return 0;
-
-failed:
-       return -EINVAL;
-}
-
-module_init(brcmf_module_init);
-module_exit(brcmf_module_cleanup);
-
 int brcmf_os_proto_block(struct brcmf_pub *drvr)
 {
        struct brcmf_info *drvr_priv = drvr->info;