Skip to content

Commit

Permalink
brcm80211: fmac: only return success in brcmf_sdbrcm_bus_init() when …
Browse files Browse the repository at this point in the history
…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: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Arend van Spriel authored and John W. Linville committed Feb 22, 2012
1 parent f3d7cdc commit c0e89f0
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -3467,21 +3467,20 @@ static int brcmf_sdbrcm_bus_init(struct device *dev)

/* Set bus state according to enable result */
bus_if->state = BRCMF_BUS_DATA;
}

else {
} else {
/* Disable F2 again */
enable = SDIO_FUNC_ENABLE_1;
brcmf_sdcard_cfg_write(bus->sdiodev, SDIO_FUNC_0,
SDIO_CCCR_IOEx, enable, NULL);
ret = -ENODEV;
}

/* Restore previous clock setting */
brcmf_sdcard_cfg_write(bus->sdiodev, SDIO_FUNC_1,
SBSDIO_FUNC1_CHIPCLKCSR, saveclk, &err);

/* 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);

exit:
Expand Down

0 comments on commit c0e89f0

Please sign in to comment.