Commit c0e89f08 authored by Arend van Spriel's avatar Arend van Spriel Committed by John W. Linville

brcm80211: fmac: only return success in brcmf_sdbrcm_bus_init() when true

The function brcmf_sdbrcm_bus_init() always returned success except for
firmware download failure. However, also when enabling SDIO function 2
is failing the function should return failure. This patch fixes that.
Reviewed-by: default avatarPieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: default avatarFranky (Zhenhui) Lin <frankyl@broadcom.com>
Signed-off-by: default avatarArend van Spriel <arend@broadcom.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent f3d7cdc3
...@@ -3467,13 +3467,12 @@ static int brcmf_sdbrcm_bus_init(struct device *dev) ...@@ -3467,13 +3467,12 @@ static int brcmf_sdbrcm_bus_init(struct device *dev)
/* Set bus state according to enable result */ /* Set bus state according to enable result */
bus_if->state = BRCMF_BUS_DATA; bus_if->state = BRCMF_BUS_DATA;
} } else {
else {
/* Disable F2 again */ /* Disable F2 again */
enable = SDIO_FUNC_ENABLE_1; enable = SDIO_FUNC_ENABLE_1;
brcmf_sdcard_cfg_write(bus->sdiodev, SDIO_FUNC_0, brcmf_sdcard_cfg_write(bus->sdiodev, SDIO_FUNC_0,
SDIO_CCCR_IOEx, enable, NULL); SDIO_CCCR_IOEx, enable, NULL);
ret = -ENODEV;
} }
/* Restore previous clock setting */ /* Restore previous clock setting */
...@@ -3481,7 +3480,7 @@ static int brcmf_sdbrcm_bus_init(struct device *dev) ...@@ -3481,7 +3480,7 @@ static int brcmf_sdbrcm_bus_init(struct device *dev)
SBSDIO_FUNC1_CHIPCLKCSR, saveclk, &err); SBSDIO_FUNC1_CHIPCLKCSR, saveclk, &err);
/* If we didn't come up, turn off backplane clock */ /* If we didn't come up, turn off backplane clock */
if (bus_if->state != BRCMF_BUS_DATA) if (!ret)
brcmf_sdbrcm_clkctl(bus, CLK_NONE, false); brcmf_sdbrcm_clkctl(bus, CLK_NONE, false);
exit: exit:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment