brcm80211: fmac: remove oneline proto block functions
authorFranky Lin <frankyl@broadcom.com>
Sat, 17 Dec 2011 02:36:52 +0000 (18:36 -0800)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 19 Dec 2011 19:40:42 +0000 (14:40 -0500)
brcmf_os_proto_block and brcmf_os_proto_unblock are oneline
functions handling proto_block mutex. Place the mutex interface
call inline to increase readability.

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_cdc.c
drivers/net/wireless/brcm80211/brcmfmac/dhd_common.c
drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c

index c87144c41331ea85fb7271574e53b8500906c341..74ea4b034001c5b76e2f80087c104841f86c2020 100644 (file)
@@ -734,9 +734,6 @@ extern void brcmf_txcomplete(struct brcmf_pub *drvr, struct sk_buff *txp,
 extern int brcmf_proto_cdc_query_dcmd(struct brcmf_pub *drvr, int ifidx,
                                       uint cmd, void *buf, uint len);
 
-/* OS independent layer functions */
-extern int brcmf_os_proto_block(struct brcmf_pub *drvr);
-extern int brcmf_os_proto_unblock(struct brcmf_pub *drvr);
 #ifdef BCMDBG
 extern int brcmf_write_to_file(struct brcmf_pub *drvr, const u8 *buf, int size);
 #endif                         /* BCMDBG */
index ebd53aa7202bcff86ad480a00ca7a6bbea395ae8..87003f8fadea78f49a8d034f01e5fec0667b40a8 100644 (file)
@@ -284,7 +284,7 @@ brcmf_proto_dcmd(struct brcmf_pub *drvr, int ifidx, struct brcmf_dcmd *dcmd,
                brcmf_dbg(ERROR, "bus is down. we have nothing to do.\n");
                return ret;
        }
-       brcmf_os_proto_block(drvr);
+       mutex_lock(&drvr->proto_block);
 
        brcmf_dbg(TRACE, "Enter\n");
 
@@ -338,7 +338,7 @@ brcmf_proto_dcmd(struct brcmf_pub *drvr, int ifidx, struct brcmf_dcmd *dcmd,
        prot->pending = false;
 
 done:
-       brcmf_os_proto_unblock(drvr);
+       mutex_unlock(&drvr->proto_block);
 
        return ret;
 }
@@ -470,19 +470,19 @@ int brcmf_proto_init(struct brcmf_pub *drvr)
 
        brcmf_dbg(TRACE, "Enter\n");
 
-       brcmf_os_proto_block(drvr);
+       mutex_lock(&drvr->proto_block);
 
        /* Get the device MAC address */
        strcpy(buf, "cur_etheraddr");
        ret = brcmf_proto_cdc_query_dcmd(drvr, 0, BRCMF_C_GET_VAR,
                                          buf, sizeof(buf));
        if (ret < 0) {
-               brcmf_os_proto_unblock(drvr);
+               mutex_unlock(&drvr->proto_block);
                return ret;
        }
        memcpy(drvr->mac, buf, ETH_ALEN);
 
-       brcmf_os_proto_unblock(drvr);
+       mutex_unlock(&drvr->proto_block);
 
        ret = brcmf_c_preinit_dcmds(drvr);
 
index 228b7edd900076a03b3fc98550d59176375f2858..5e5a95446f518c4e5e45708505715812118517b5 100644 (file)
@@ -804,7 +804,7 @@ int brcmf_c_preinit_dcmds(struct brcmf_pub *drvr)
        int scan_unassoc_time = 40;
        int i;
 
-       brcmf_os_proto_block(drvr);
+       mutex_lock(&drvr->proto_block);
 
        /* Set Country code */
        if (drvr->country_code[0] != 0) {
@@ -873,7 +873,7 @@ int brcmf_c_preinit_dcmds(struct brcmf_pub *drvr)
                                                 0, true);
        }
 
-       brcmf_os_proto_unblock(drvr);
+       mutex_unlock(&drvr->proto_block);
 
        return 0;
 }
index f9cc5f8daabaed24cfc42b9838cfc8d552c4a609..cd0a698aaa7fe39f2156ab90e6e532bd55c1131a 100644 (file)
@@ -1112,25 +1112,6 @@ void brcmf_detach(struct brcmf_pub *drvr)
        }
 }
 
-int brcmf_os_proto_block(struct brcmf_pub *drvr)
-{
-       if (drvr) {
-               mutex_lock(&drvr->proto_block);
-               return 1;
-       }
-       return 0;
-}
-
-int brcmf_os_proto_unblock(struct brcmf_pub *drvr)
-{
-       if (drvr) {
-               mutex_unlock(&drvr->proto_block);
-               return 1;
-       }
-
-       return 0;
-}
-
 static int brcmf_get_pend_8021x_cnt(struct brcmf_pub *drvr)
 {
        return atomic_read(&drvr->pend_8021x_cnt);