brcmfmac: postpone interrupt register function
authorFranky Lin <frankyl@broadcom.com>
Sat, 28 Apr 2012 01:56:58 +0000 (18:56 -0700)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 9 May 2012 01:53:54 +0000 (21:53 -0400)
For out of band interrupt which is going to be introduced shortly,
the interrupt register function must be called after firmware is
downloaded. This patch moves it from brcmf_sdbrcm_probe to
brcmf_sdbrcm_bus_init.

Reviewed-by: pieter-paul giesberts <pieterpg@broadcom.com>
Reviewed-by: arend van spriel <arend@broadcom.com>
Signed-off-by: franky lin <frankyl@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c

index ad46f34b582e6be5f517210d11d07a7f402c4964..e3b1c32c83bb36be653b26890b09f5c130c07a91 100644 (file)
@@ -3508,6 +3508,12 @@ static int brcmf_sdbrcm_bus_init(struct device *dev)
        brcmf_sdcard_cfg_write(bus->sdiodev, SDIO_FUNC_1,
                               SBSDIO_FUNC1_CHIPCLKCSR, saveclk, &err);
 
+       if (ret == 0) {
+               ret = brcmf_sdcard_intr_reg(bus->sdiodev);
+               if (ret != 0)
+                       brcmf_dbg(ERROR, "intr register failed:%d\n", ret);
+       }
+
        /* If we didn't come up, turn off backplane clock */
        if (bus_if->state != BRCMF_BUS_DATA)
                brcmf_sdbrcm_clkctl(bus, CLK_NONE, false);
@@ -3968,15 +3974,6 @@ void *brcmf_sdbrcm_probe(u32 regsva, struct brcmf_sdio_dev *sdiodev)
                goto fail;
        }
 
-       /* Register interrupt callback, but mask it (not operational yet). */
-       brcmf_dbg(INTR, "disable SDIO interrupts (not interested yet)\n");
-       ret = brcmf_sdcard_intr_reg(bus->sdiodev);
-       if (ret != 0) {
-               brcmf_dbg(ERROR, "FAILED: sdcard_intr_reg returned %d\n", ret);
-               goto fail;
-       }
-       brcmf_dbg(INTR, "registered SDIO interrupt function ok\n");
-
        brcmf_dbg(INFO, "completed!!\n");
 
        /* if firmware path present try to download and bring up bus */