brcmfmac: only disable clock when brcmf_sdio_bus_init() fails
authorArend van Spriel <arend@broadcom.com>
Mon, 6 Jan 2014 11:40:45 +0000 (12:40 +0100)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 6 Jan 2014 20:48:03 +0000 (15:48 -0500)
The condition to disable the clock at the end of brcmf_sdio_bus_init()
was wrong as the bus state is updated by the calling function. Hence,
the clock was always disabled after brcmf_sdio_bus_init() which was
not the intended behaviour.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Franky Lin <frankyl@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c

index 124f5e8..2bf4757 100644 (file)
@@ -3630,7 +3630,7 @@ static int brcmf_sdio_bus_init(struct device *dev)
        }
 
        /* If we didn't come up, turn off backplane clock */
-       if (bus_if->state != BRCMF_BUS_DATA)
+       if (ret != 0)
                brcmf_sdio_clkctl(bus, CLK_NONE, false);
 
 exit: