brcm80211: fmac: change function brcmf_detach parameter
authorFranky Lin <frankyl@broadcom.com>
Sat, 17 Dec 2011 02:36:56 +0000 (18:36 -0800)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 19 Dec 2011 19:40:43 +0000 (14:40 -0500)
Change parameter to device pointer for bus layer interface function
brcmf_detach. This is part of the fullmac bus interface refactoring.

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Reviewed-by: Alwin Beukers <alwin@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.h
drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c
drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c

index 0f1384dd62be7e0dcc6fb7e08700e4024e2c06b3..4e59c86c245bb6b679bcb5cf3aaf1377dfbef5b0 100644 (file)
@@ -703,7 +703,7 @@ extern int brcmf_netdev_wait_pend8021x(struct net_device *ndev);
 extern s32 brcmf_exec_dcmd(struct net_device *dev, u32 cmd, void *arg, u32 len);
 
 /* Indication from bus module regarding removal/absence of dongle */
-extern void brcmf_detach(struct brcmf_pub *drvr);
+extern void brcmf_detach(struct device *dev);
 
 /* Indication from bus module to change flow-control state */
 extern void brcmf_txflowcontrol(struct brcmf_pub *drvr, int ifidx, bool on);
index 0440471c083ba6d7094e9dd9c2272ea07627a3c6..6b0739b1870c563698542ed8a6c6ba7ec7045485 100644 (file)
@@ -955,7 +955,7 @@ struct brcmf_pub *brcmf_attach(struct brcmf_sdio *bus, uint bus_hdrlen,
 
 fail:
        if (drvr)
-               brcmf_detach(drvr);
+               brcmf_detach(dev);
 
        return NULL;
 }
@@ -1093,29 +1093,30 @@ static void brcmf_bus_detach(struct brcmf_pub *drvr)
        }
 }
 
-void brcmf_detach(struct brcmf_pub *drvr)
+void brcmf_detach(struct device *dev)
 {
+       int i;
+       struct brcmf_bus *bus_if = dev_get_drvdata(dev);
+       struct brcmf_pub *drvr = bus_if->drvr;
+
        brcmf_dbg(TRACE, "Enter\n");
 
-       if (drvr) {
-               int i;
 
-               /* make sure primary interface removed last */
-               for (i = BRCMF_MAX_IFS-1; i > -1; i--)
-                       if (drvr->iflist[i])
-                               brcmf_del_if(drvr, i);
+       /* make sure primary interface removed last */
+       for (i = BRCMF_MAX_IFS-1; i > -1; i--)
+               if (drvr->iflist[i])
+                       brcmf_del_if(drvr, i);
 
-               cancel_work_sync(&drvr->setmacaddr_work);
-               cancel_work_sync(&drvr->multicast_work);
+       cancel_work_sync(&drvr->setmacaddr_work);
+       cancel_work_sync(&drvr->multicast_work);
 
-               brcmf_bus_detach(drvr);
+       brcmf_bus_detach(drvr);
 
-               if (drvr->prot)
-                       brcmf_proto_detach(drvr);
+       if (drvr->prot)
+               brcmf_proto_detach(drvr);
 
-               drvr->bus_if->drvr = NULL;
-               kfree(drvr);
-       }
+       bus_if->drvr = NULL;
+       kfree(drvr);
 }
 
 static int brcmf_get_pend_8021x_cnt(struct brcmf_pub *drvr)
index a9616271ed1bf4a0afa192306e07fc4dcb2ddd5f..6e347edda561ac5c0ba7e22b3f4a63a4e9f06d8a 100644 (file)
@@ -3865,8 +3865,8 @@ static void brcmf_sdbrcm_release(struct brcmf_sdio *bus)
                /* De-register interrupt handler */
                brcmf_sdcard_intr_dereg(bus->sdiodev);
 
-               if (bus->drvr) {
-                       brcmf_detach(bus->drvr);
+               if (bus->sdiodev->bus_if->drvr) {
+                       brcmf_detach(bus->sdiodev->dev);
                        brcmf_sdbrcm_release_dongle(bus);
                        bus->drvr = NULL;
                }