From: Arend van Spriel Date: Mon, 8 Aug 2011 13:58:03 +0000 (+0200) Subject: staging: brcm80211: use mutex instead of semaphore in dhd_linux.c X-Git-Tag: upstream/snapshot3+hdmi~8929^2^2~864^2~365 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=26f1283099600b33f879cb222dd320c111650c0b;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git staging: brcm80211: use mutex instead of semaphore in dhd_linux.c The semaphore proto_sem has been replaced with mutex proto_block which lock certain code paths for one thread. Signed-off-by: Arend van Spriel Reviewed-by: Roland Vossen Reviewed-by: Franky Lin Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c index 05dada9..4ba9d7d 100644 --- a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c +++ b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c @@ -28,8 +28,8 @@ #include #include #include -#include #include +#include #include #include #include @@ -75,7 +75,7 @@ struct brcmf_info { /* OS/stack specifics */ struct brcmf_if *iflist[BRCMF_MAX_IFS]; - struct semaphore proto_sem; + struct mutex proto_block; wait_queue_head_t ioctl_resp_wait; /* Thread to issue ioctl for multicast */ @@ -1314,7 +1314,7 @@ struct brcmf_pub *brcmf_attach(struct brcmf_bus *bus, uint bus_hdrlen) goto fail; net->netdev_ops = NULL; - sema_init(&drvr_priv->proto_sem, 1); + mutex_init(&drvr_priv->proto_block); /* Initialize other structure content */ init_waitqueue_head(&drvr_priv->ioctl_resp_wait); @@ -1584,7 +1584,7 @@ int brcmf_os_proto_block(struct brcmf_pub *drvr) struct brcmf_info *drvr_priv = drvr->info; if (drvr_priv) { - down(&drvr_priv->proto_sem); + mutex_lock(&drvr_priv->proto_block); return 1; } return 0; @@ -1595,7 +1595,7 @@ int brcmf_os_proto_unblock(struct brcmf_pub *drvr) struct brcmf_info *drvr_priv = drvr->info; if (drvr_priv) { - up(&drvr_priv->proto_sem); + mutex_unlock(&drvr_priv->proto_block); return 1; }