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 adee305..7a2325b 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 a249407..118216b 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 62413e8..73d3280 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;