staging: rtl8192e: MgntActSet_RF_State: remove ProtectOrNot parameter
authorMateusz Kulikowski <mateusz.kulikowski@gmail.com>
Tue, 28 Jul 2015 21:31:41 +0000 (23:31 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 31 Jul 2015 23:21:37 +0000 (16:21 -0700)
It is set at the very beginning of function to a constant value.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c
drivers/staging/rtl8192e/rtl8192e/rtl_core.c
drivers/staging/rtl8192e/rtl8192e/rtl_core.h
drivers/staging/rtl8192e/rtl8192e/rtl_dm.c
drivers/staging/rtl8192e/rtl8192e/rtl_pm.c
drivers/staging/rtl8192e/rtl8192e/rtl_ps.c

index f8ad81e8fb1fb64c68fe372bd203743d744ec632..b2f307f3a442d214eddced4af49bf8cc3138badb 100644 (file)
@@ -882,19 +882,17 @@ start:
                RT_TRACE((COMP_INIT | COMP_RF | COMP_POWER),
                          "%s(): Turn off RF for RegRfOff ----------\n",
                          __func__);
-               rtl92e_set_rf_state(dev, eRfOff, RF_CHANGE_BY_SW, true);
+               rtl92e_set_rf_state(dev, eRfOff, RF_CHANGE_BY_SW);
        } else if (priv->rtllib->RfOffReason > RF_CHANGE_BY_PS) {
                RT_TRACE((COMP_INIT|COMP_RF|COMP_POWER),
                         "%s(): Turn off RF for RfOffReason(%d) ----------\n",
                         __func__, priv->rtllib->RfOffReason);
-               rtl92e_set_rf_state(dev, eRfOff, priv->rtllib->RfOffReason,
-                                   true);
+               rtl92e_set_rf_state(dev, eRfOff, priv->rtllib->RfOffReason);
        } else if (priv->rtllib->RfOffReason >= RF_CHANGE_BY_IPS) {
                RT_TRACE((COMP_INIT|COMP_RF|COMP_POWER),
                         "%s(): Turn off RF for RfOffReason(%d) ----------\n",
                         __func__, priv->rtllib->RfOffReason);
-               rtl92e_set_rf_state(dev, eRfOff, priv->rtllib->RfOffReason,
-                                   true);
+               rtl92e_set_rf_state(dev, eRfOff, priv->rtllib->RfOffReason);
        } else {
                RT_TRACE((COMP_INIT|COMP_RF|COMP_POWER), "%s(): RF-ON\n",
                          __func__);
index 4157f8a58409af687b8c1e1f8ea9a44beadab786..0033cfb21351d9f0af5f13e2fbaa5106085a0aec 100644 (file)
@@ -149,8 +149,7 @@ void rtl92e_writew(struct net_device *dev, int x, u16 y)
 *****************************************************************************/
 bool rtl92e_set_rf_state(struct net_device *dev,
                         enum rt_rf_power_state StateToSet,
-                        RT_RF_CHANGE_SOURCE ChangeSource,
-                        bool   ProtectOrNot)
+                        RT_RF_CHANGE_SOURCE ChangeSource)
 {
        struct r8192_priv *priv = rtllib_priv(dev);
        struct rtllib_device *ieee = priv->rtllib;
@@ -163,37 +162,32 @@ bool rtl92e_set_rf_state(struct net_device *dev,
        RT_TRACE((COMP_PS | COMP_RF),
                 "===>rtl92e_set_rf_state(): StateToSet(%d)\n", StateToSet);
 
-       ProtectOrNot = false;
-
+       while (true) {
+               spin_lock_irqsave(&priv->rf_ps_lock, flag);
+               if (priv->RFChangeInProgress) {
+                       spin_unlock_irqrestore(&priv->rf_ps_lock, flag);
+                       RT_TRACE((COMP_PS | COMP_RF),
+                                "rtl92e_set_rf_state(): RF Change in progress! Wait to set..StateToSet(%d).\n",
+                                StateToSet);
 
-       if (!ProtectOrNot) {
-               while (true) {
-                       spin_lock_irqsave(&priv->rf_ps_lock, flag);
-                       if (priv->RFChangeInProgress) {
-                               spin_unlock_irqrestore(&priv->rf_ps_lock, flag);
+                       while (priv->RFChangeInProgress) {
+                               RFWaitCounter++;
                                RT_TRACE((COMP_PS | COMP_RF),
-                                        "rtl92e_set_rf_state(): RF Change in progress! Wait to set..StateToSet(%d).\n",
-                                        StateToSet);
-
-                               while (priv->RFChangeInProgress) {
-                                       RFWaitCounter++;
-                                       RT_TRACE((COMP_PS | COMP_RF),
-                                                "rtl92e_set_rf_state(): Wait 1 ms (%d times)...\n",
-                                                RFWaitCounter);
-                                       mdelay(1);
-
-                                       if (RFWaitCounter > 100) {
-                                               netdev_warn(dev,
-                                                           "%s(): Timeout waiting for RF change.\n",
-                                                           __func__);
-                                               return false;
-                                       }
+                                        "rtl92e_set_rf_state(): Wait 1 ms (%d times)...\n",
+                                        RFWaitCounter);
+                               mdelay(1);
+
+                               if (RFWaitCounter > 100) {
+                                       netdev_warn(dev,
+                                                   "%s(): Timeout waiting for RF change.\n",
+                                                   __func__);
+                                       return false;
                                }
-                       } else {
-                               priv->RFChangeInProgress = true;
-                               spin_unlock_irqrestore(&priv->rf_ps_lock, flag);
-                               break;
                        }
+               } else {
+                       priv->RFChangeInProgress = true;
+                       spin_unlock_irqrestore(&priv->rf_ps_lock, flag);
+                       break;
                }
        }
 
@@ -270,11 +264,9 @@ bool rtl92e_set_rf_state(struct net_device *dev,
                         StateToSet, ChangeSource, priv->rtllib->RfOffReason);
        }
 
-       if (!ProtectOrNot) {
-               spin_lock_irqsave(&priv->rf_ps_lock, flag);
-               priv->RFChangeInProgress = false;
-               spin_unlock_irqrestore(&priv->rf_ps_lock, flag);
-       }
+       spin_lock_irqsave(&priv->rf_ps_lock, flag);
+       priv->RFChangeInProgress = false;
+       spin_unlock_irqrestore(&priv->rf_ps_lock, flag);
 
        RT_TRACE((COMP_PS | COMP_RF), "<===rtl92e_set_rf_state()\n");
        return bActionAllowed;
index bdb50323f61be1c66db7dad44cc73af29574c5ab..cd948bb1384018169b2b6686735ac380e0ff7424 100644 (file)
@@ -617,6 +617,5 @@ bool rtl92e_disable_nic(struct net_device *dev);
 
 bool rtl92e_set_rf_state(struct net_device *dev,
                         enum rt_rf_power_state StateToSet,
-                        RT_RF_CHANGE_SOURCE ChangeSource,
-                        bool   ProtectOrNot);
+                        RT_RF_CHANGE_SOURCE ChangeSource);
 #endif
index 458097ee09e73257d0e98f0264d6ec98261813c1..1a0c690bfa075d45adb3ca3dcf8efa2d185c73a8 100644 (file)
@@ -1888,8 +1888,7 @@ static void dm_CheckRfCtrlGPIO(void *data)
        if (bActuallySet) {
                mdelay(1000);
                priv->bHwRfOffAction = 1;
-               rtl92e_set_rf_state(dev, eRfPowerStateToSet, RF_CHANGE_BY_HW,
-                                   true);
+               rtl92e_set_rf_state(dev, eRfPowerStateToSet, RF_CHANGE_BY_HW);
                if (priv->bHwRadioOff)
                        argv[1] = "RFOFF";
                else
index c224adedaf6288f614234be82f844f52e8c3ea4c..b0268fdc100f4c9e37fb4fedc4f1678118fd6633 100644 (file)
@@ -45,7 +45,7 @@ int rtl92e_suspend(struct pci_dev *pdev, pm_message_t state)
        netif_device_detach(dev);
 
        if (!priv->rtllib->bSupportRemoteWakeUp) {
-               rtl92e_set_rf_state(dev, eRfOff, RF_CHANGE_BY_INIT, true);
+               rtl92e_set_rf_state(dev, eRfOff, RF_CHANGE_BY_INIT);
                ulRegRead = rtl92e_readl(dev, CPU_GEN);
                ulRegRead |= CPU_GEN_SYSTEM_RESET;
                rtl92e_writel(dev, CPU_GEN, ulRegRead);
@@ -108,7 +108,7 @@ int rtl92e_resume(struct pci_dev *pdev)
                dev->netdev_ops->ndo_open(dev);
 
        if (!priv->rtllib->bSupportRemoteWakeUp)
-               rtl92e_set_rf_state(dev, eRfOn, RF_CHANGE_BY_INIT, true);
+               rtl92e_set_rf_state(dev, eRfOn, RF_CHANGE_BY_INIT);
 
 out:
        RT_TRACE(COMP_POWER, "<================r8192E resume call.\n");
index 38addad24f182a03919349ddebfcb5d21da00cd0..f09560d60dc4f2c96add5d3c33c356988506441a 100644 (file)
@@ -45,7 +45,7 @@ static void rtl8192_hw_sleep_down(struct net_device *dev)
        spin_unlock_irqrestore(&priv->rf_ps_lock, flags);
        RT_TRACE(COMP_DBG, "%s()============>come to sleep down\n", __func__);
 
-       rtl92e_set_rf_state(dev, eRfSleep, RF_CHANGE_BY_PS, false);
+       rtl92e_set_rf_state(dev, eRfSleep, RF_CHANGE_BY_PS);
 }
 
 void rtl92e_hw_sleep_wq(void *data)
@@ -74,7 +74,7 @@ void rtl92e_hw_wakeup(struct net_device *dev)
        }
        spin_unlock_irqrestore(&priv->rf_ps_lock, flags);
        RT_TRACE(COMP_PS, "%s()============>come to wake up\n", __func__);
-       rtl92e_set_rf_state(dev, eRfOn, RF_CHANGE_BY_PS, false);
+       rtl92e_set_rf_state(dev, eRfOn, RF_CHANGE_BY_PS);
 }
 
 void rtl92e_hw_wakeup_wq(void *data)
@@ -133,8 +133,7 @@ static void InactivePsWorkItemCallback(struct net_device *dev)
 
        RT_TRACE(COMP_PS, "InactivePsWorkItemCallback(): Set RF to %s.\n",
                 pPSC->eInactivePowerState == eRfOff ? "OFF" : "ON");
-       rtl92e_set_rf_state(dev, pPSC->eInactivePowerState, RF_CHANGE_BY_IPS,
-                           false);
+       rtl92e_set_rf_state(dev, pPSC->eInactivePowerState, RF_CHANGE_BY_IPS);
 
        pPSC->bSwRfProcessing = false;
        RT_TRACE(COMP_PS, "InactivePsWorkItemCallback() <---------\n");