From patchwork Wed Jun 1 09:26:54 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Binoy Jayan X-Patchwork-Id: 69003 Delivered-To: patch@linaro.org Received: by 10.140.92.199 with SMTP id b65csp2422082qge; Wed, 1 Jun 2016 02:28:00 -0700 (PDT) X-Received: by 10.98.78.206 with SMTP id c197mr6617032pfb.129.1464773278095; Wed, 01 Jun 2016 02:27:58 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d63si48221236pfc.180.2016.06.01.02.27.57; Wed, 01 Jun 2016 02:27:58 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757872AbcFAJ1n (ORCPT + 30 others); Wed, 1 Jun 2016 05:27:43 -0400 Received: from mail-pf0-f171.google.com ([209.85.192.171]:35181 "EHLO mail-pf0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757806AbcFAJ1f (ORCPT ); Wed, 1 Jun 2016 05:27:35 -0400 Received: by mail-pf0-f171.google.com with SMTP id g64so11849428pfb.2 for ; Wed, 01 Jun 2016 02:27:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=l34bYdqM7V2cdzfdKvAxaTsPxijCHWR0zd/GGFMkcc0=; b=NDijQJE6y2Xfst6KrK69LxSN4AN38BTeEF6FdxNjgCVmKgD56LW74uSC3zO9jmgGkI g9vRK7YYKKsOC1fZ1+1ZzUR6+CdCuoz977f3oWIJ4qJ4QJVLdXOmRFcV8K5ECkMJbfNn Dvhtp4D5fMP9ryEGO4alaka2t2eOPjWOYtYUk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=l34bYdqM7V2cdzfdKvAxaTsPxijCHWR0zd/GGFMkcc0=; b=RO9upvJxfi0F78wT5lorwwkX7x6a1bd2FBf+r8jN+wqCmaHaayEysqB5lqdWsM9r56 XzVmFAMjL7tj2+A7fl+BuDkjA3G4R3ngVmvK2B4kw5GRrTuqJ/XrkPNAmdOfYeYpI9qb o1jOOueWgQn/C+mIPRRv+hy9Abs4mizaj3fgxXlwXvQJ4ROhPJHWHdfAUM7HlnriH5Ot AkETKFS0FQW+1Iwckyu7SfyeIOc6Q7nEzxOos1Zadq4HyNm1F7Bvyy/0uEu9heLNqlde 54Ti01DV8huF4veQWv8Plf9o6khiq7PJlk/DmZbx21ee6Z6/tYoMtxzSAI11Lan48fiv mUlw== X-Gm-Message-State: ALyK8tIGT18zE1N5Cq7nX3OqvsXYBdtJSDK8Vv92L2Ij+ibrg2FTHlB617OK5FGOHt1AeD5O X-Received: by 10.98.69.202 with SMTP id n71mr6778294pfi.82.1464773254929; Wed, 01 Jun 2016 02:27:34 -0700 (PDT) Received: from blr-ubuntu-59.ap.qualcomm.com ([202.46.23.61]) by smtp.gmail.com with ESMTPSA id b67sm46398155pfc.74.2016.06.01.02.27.31 (version=TLS1_1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 01 Jun 2016 02:27:34 -0700 (PDT) From: Binoy Jayan To: Greg Kroah-Hartman Cc: Arnd Bergmann , Mateusz Kulikowski , devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, Binoy Jayan Subject: [PATCH 3/5] rtl8192e: Replace semaphore rf_sem with mutex Date: Wed, 1 Jun 2016 14:56:54 +0530 Message-Id: <1464773216-32014-4-git-send-email-binoy.jayan@linaro.org> X-Mailer: git-send-email 1.8.2.1 In-Reply-To: <1464773216-32014-1-git-send-email-binoy.jayan@linaro.org> References: <1464773216-32014-1-git-send-email-binoy.jayan@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The semaphore 'rf_sem' in the rtl8192e is a simple mutex, so it should be written as one. Semaphores are going away in the future. Signed-off-by: Binoy Jayan --- This patch depends on the following patch: rtl8192e: r8192_priv: Replace semaphore wx_sem with mutex drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c | 4 ++-- drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 2 +- drivers/staging/rtl8192e/rtl8192e/rtl_core.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c b/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c index 5e3bbe5..14fbcaa 100644 --- a/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c +++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c @@ -256,7 +256,7 @@ u32 rtl92e_get_rf_reg(struct net_device *dev, enum rf90_radio_path eRFPath, return 0; if (priv->rtllib->eRFPowerState != eRfOn && !priv->being_init_adapter) return 0; - down(&priv->rf_sem); + mutex_lock(&priv->rf_mutex); if (priv->Rf_Mode == RF_OP_By_FW) { Original_Value = _rtl92e_phy_rf_fw_read(dev, eRFPath, RegAddr); udelay(200); @@ -265,7 +265,7 @@ u32 rtl92e_get_rf_reg(struct net_device *dev, enum rf90_radio_path eRFPath, } BitShift = _rtl92e_calculate_bit_shift(BitMask); Readback_Value = (Original_Value & BitMask) >> BitShift; - up(&priv->rf_sem); + mutex_unlock(&priv->rf_mutex); return Readback_Value; } diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c index 46a5c49..3d1948a 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c @@ -994,7 +994,7 @@ static void _rtl92e_init_priv_lock(struct r8192_priv *priv) spin_lock_init(&priv->rf_ps_lock); spin_lock_init(&priv->ps_lock); mutex_init(&priv->wx_mutex); - sema_init(&priv->rf_sem, 1); + mutex_init(&priv->rf_mutex); mutex_init(&priv->mutex); } diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.h b/drivers/staging/rtl8192e/rtl8192e/rtl_core.h index 369ebf1..6ead460 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.h +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.h @@ -376,7 +376,7 @@ struct r8192_priv { struct tasklet_struct irq_prepare_beacon_tasklet; struct mutex wx_mutex; - struct semaphore rf_sem; + struct mutex rf_mutex; struct mutex mutex; struct rt_stats stats;