Skip to content

Commit d84d99e

Browse files
Hante MeulemanKalle Valo
authored andcommitted
brcmfmac: move module init and exit to common
In preparation of module parameters for all devices the module init and exit routines are moved to the common file. Reviewed-by: Arend Van Spriel <[email protected]> Reviewed-by: Franky (Zhenhui) Lin <[email protected]> Reviewed-by: Pieter-Paul Giesberts <[email protected]> Signed-off-by: Hante Meuleman <[email protected]> Signed-off-by: Arend van Spriel <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
1 parent e9217b4 commit d84d99e

File tree

4 files changed

+39
-15
lines changed

4 files changed

+39
-15
lines changed

drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@
2828
#include "tracepoint.h"
2929
#include "common.h"
3030

31+
MODULE_AUTHOR("Broadcom Corporation");
32+
MODULE_DESCRIPTION("Broadcom 802.11 wireless LAN fullmac driver.");
33+
MODULE_LICENSE("Dual BSD/GPL");
34+
3135
const u8 ALLFFMAC[ETH_ALEN] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
3236

3337
#define BRCMF_DEFAULT_SCAN_CHANNEL_TIME 40
@@ -221,7 +225,7 @@ void __brcmf_dbg(u32 level, const char *func, const char *fmt, ...)
221225
}
222226
#endif
223227

224-
void brcmf_mp_attach(void)
228+
static void brcmf_mp_attach(void)
225229
{
226230
strlcpy(brcmf_mp_global.firmware_path, brcmf_firmware_path,
227231
BRCMF_FW_ALTPATH_LEN);
@@ -249,3 +253,33 @@ void brcmf_mp_device_detach(struct brcmf_pub *drvr)
249253
kfree(drvr->settings);
250254
}
251255

256+
static int __init brcmfmac_module_init(void)
257+
{
258+
int err;
259+
260+
/* Initialize debug system first */
261+
brcmf_debugfs_init();
262+
263+
#ifdef CONFIG_BRCMFMAC_SDIO
264+
brcmf_sdio_init();
265+
#endif
266+
/* Initialize global module paramaters */
267+
brcmf_mp_attach();
268+
269+
/* Continue the initialization by registering the different busses */
270+
err = brcmf_core_init();
271+
if (err)
272+
brcmf_debugfs_exit();
273+
274+
return err;
275+
}
276+
277+
static void __exit brcmfmac_module_exit(void)
278+
{
279+
brcmf_core_exit();
280+
brcmf_debugfs_exit();
281+
}
282+
283+
module_init(brcmfmac_module_init);
284+
module_exit(brcmfmac_module_exit);
285+

drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ struct brcmf_mp_device {
8989
struct cc_translate *country_codes;
9090
};
9191

92-
void brcmf_mp_attach(void);
9392
int brcmf_mp_device_attach(struct brcmf_pub *drvr);
9493
void brcmf_mp_device_detach(struct brcmf_pub *drvr);
9594
#ifdef DEBUG

drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,6 @@
3838
#include "pcie.h"
3939
#include "common.h"
4040

41-
MODULE_AUTHOR("Broadcom Corporation");
42-
MODULE_DESCRIPTION("Broadcom 802.11 wireless LAN fullmac driver.");
43-
MODULE_LICENSE("Dual BSD/GPL");
44-
4541
#define MAX_WAIT_FOR_8021X_TX msecs_to_jiffies(950)
4642

4743
/* AMPDU rx reordering definitions */
@@ -1422,19 +1418,15 @@ static void brcmf_driver_register(struct work_struct *work)
14221418
}
14231419
static DECLARE_WORK(brcmf_driver_work, brcmf_driver_register);
14241420

1425-
static int __init brcmfmac_module_init(void)
1421+
int __init brcmf_core_init(void)
14261422
{
1427-
brcmf_debugfs_init();
1428-
#ifdef CONFIG_BRCMFMAC_SDIO
1429-
brcmf_sdio_init();
1430-
#endif
14311423
if (!schedule_work(&brcmf_driver_work))
14321424
return -EBUSY;
14331425

14341426
return 0;
14351427
}
14361428

1437-
static void __exit brcmfmac_module_exit(void)
1429+
void __exit brcmf_core_exit(void)
14381430
{
14391431
cancel_work_sync(&brcmf_driver_work);
14401432

@@ -1447,8 +1439,5 @@ static void __exit brcmfmac_module_exit(void)
14471439
#ifdef CONFIG_BRCMFMAC_PCIE
14481440
brcmf_pcie_exit();
14491441
#endif
1450-
brcmf_debugfs_exit();
14511442
}
14521443

1453-
module_init(brcmfmac_module_init);
1454-
module_exit(brcmfmac_module_exit);

drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,5 +227,7 @@ void brcmf_txflowblock_if(struct brcmf_if *ifp,
227227
void brcmf_txfinalize(struct brcmf_if *ifp, struct sk_buff *txp, bool success);
228228
void brcmf_netif_rx(struct brcmf_if *ifp, struct sk_buff *skb);
229229
void brcmf_net_setcarrier(struct brcmf_if *ifp, bool on);
230+
int __init brcmf_core_init(void);
231+
void __exit brcmf_core_exit(void);
230232

231233
#endif /* BRCMFMAC_CORE_H */

0 commit comments

Comments
 (0)