diff mbox

[1/8] brcmfmac: move brcmf_bus_preinit() call just after changing bus state

Message ID 1519082065-10128-2-git-send-email-arend.vanspriel@broadcom.com (mailing list archive)
State Accepted
Commit da472385a29f1fddcac7cfa0499482704310bd16
Delegated to: Kalle Valo
Headers show

Commit Message

Arend van Spriel Feb. 19, 2018, 11:14 p.m. UTC
Moving the brcmf_bus_preinit() call allows the bus code to do some
required initialization before handling firmware control messages.

Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
Reviewed-by: Franky Lin <franky.lin@broadcom.com>
Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
---
 drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c | 3 ---
 drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c   | 5 +++++
 2 files changed, 5 insertions(+), 3 deletions(-)

Comments

Kalle Valo Feb. 27, 2018, 4:23 p.m. UTC | #1
Arend Van Spriel <arend.vanspriel@broadcom.com> wrote:

> Moving the brcmf_bus_preinit() call allows the bus code to do some
> required initialization before handling firmware control messages.
> 
> Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com>
> Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
> Reviewed-by: Franky Lin <franky.lin@broadcom.com>
> Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>

8 patches applied to wireless-drivers-next.git, thanks.

da472385a29f brcmfmac: move brcmf_bus_preinit() call just after changing bus state
4b5adc736828 brcmfmac: move allocation of control rx buffer to brcmf_sdio_bus_preinit()
262f2b53f679 brcmfmac: call brcmf_attach() just before calling brcmf_bus_started()
a7f4a80c0070 brcmfmac: usb: call brcmf_usb_up() during brcmf_bus_preinit()
0542503c4c16 brcmfmac: move brcmf_attach() function in core.c
de2a3027f6f1 brcmfmac: remove brcmf_bus_started() from bus api
d678296bfb9a brcmfmac: change log level for some low-level sdio functions
2d6edad4b2da brcmfmac: remove duplicate pointer variable from brcmf_sdio_firmware_callback()
diff mbox

Patch

diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c
index 9be0b05..70ef983 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c
@@ -365,9 +365,6 @@  int brcmf_c_preinit_dcmds(struct brcmf_if *ifp)
 
 	/* Enable tx beamforming, errors can be ignored (not supported) */
 	(void)brcmf_fil_iovar_int_set(ifp, "txbf", 1);
-
-	/* do bus specific preinit here */
-	err = brcmf_bus_preinit(ifp->drvr->bus_if);
 done:
 	return err;
 }
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
index 930e423..6dd6da7 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
@@ -1013,6 +1013,11 @@  int brcmf_bus_started(struct device *dev)
 	/* signal bus ready */
 	brcmf_bus_change_state(bus_if, BRCMF_BUS_UP);
 
+	/* do bus specific preinit here */
+	ret = brcmf_bus_preinit(ifp->drvr->bus_if);
+	if (ret < 0)
+		goto fail;
+
 	/* Bus is ready, do any initialization */
 	ret = brcmf_c_preinit_dcmds(ifp);
 	if (ret < 0)