From da472385a29f1fddcac7cfa0499482704310bd16 Mon Sep 17 00:00:00 2001 From: Arend Van Spriel Date: Tue, 20 Feb 2018 00:14:18 +0100 Subject: [PATCH] brcmfmac: move brcmf_bus_preinit() call just after changing bus state Moving the brcmf_bus_preinit() call allows the bus code to do some required initialization before handling firmware control messages. Reviewed-by: Hante Meuleman Reviewed-by: Pieter-Paul Giesberts Reviewed-by: Franky Lin Signed-off-by: Arend van Spriel Signed-off-by: Kalle Valo --- 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(-) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c index 9be0b051066a..70ef9835b647 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 930e423f83a8..6dd6da7b9481 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) -- GitLab