staging: r8188eu: remove switches from phy_RF6052_Config_ParaFile()
authorMichael Straube <straube.linux@gmail.com>
Fri, 17 Sep 2021 08:06:15 +0000 (10:06 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 17 Sep 2021 14:32:06 +0000 (16:32 +0200)
In function phy_RF6052_Config_ParaFile() the variable eRFPath is always 0
and RF_PATH_A = 0 in this driver. So we can remove the 'switch (eRFPath)'
statements and just keep the code from the RF_PATH_A cases.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210917080615.25819-5-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/r8188eu/hal/rtl8188e_rf6052.c

index 63e8505..2f16c09 100644 (file)
@@ -466,16 +466,8 @@ static int phy_RF6052_Config_ParaFile(struct adapter *Adapter)
        pPhyReg = &pHalData->PHYRegDef[eRFPath];
 
        /*----Store original RFENV control type----*/
-       switch (eRFPath) {
-       case RF_PATH_A:
-       case RF_PATH_C:
-               u4RegValue = PHY_QueryBBReg(Adapter, pPhyReg->rfintfs, bRFSI_RFENV);
-               break;
-       case RF_PATH_B:
-       case RF_PATH_D:
-               u4RegValue = PHY_QueryBBReg(Adapter, pPhyReg->rfintfs, bRFSI_RFENV << 16);
-               break;
-       }
+       u4RegValue = PHY_QueryBBReg(Adapter, pPhyReg->rfintfs, bRFSI_RFENV);
+
        /*----Set RF_ENV enable----*/
        PHY_SetBBReg(Adapter, pPhyReg->rfintfe, bRFSI_RFENV << 16, 0x1);
        udelay(1);/* PlatformStallExecution(1); */
@@ -492,31 +484,12 @@ static int phy_RF6052_Config_ParaFile(struct adapter *Adapter)
        udelay(1);/* PlatformStallExecution(1); */
 
        /*----Initialize RF fom connfiguration file----*/
-       switch (eRFPath) {
-       case RF_PATH_A:
-               if (HAL_STATUS_FAILURE == ODM_ConfigRFWithHeaderFile(&pHalData->odmpriv, (enum rf_radio_path)eRFPath, (enum rf_radio_path)eRFPath))
-                       rtStatus = _FAIL;
-               break;
-       case RF_PATH_B:
        if (HAL_STATUS_FAILURE == ODM_ConfigRFWithHeaderFile(&pHalData->odmpriv, (enum rf_radio_path)eRFPath, (enum rf_radio_path)eRFPath))
-                       rtStatus = _FAIL;
-               break;
-       case RF_PATH_C:
-               break;
-       case RF_PATH_D:
-               break;
-       }
+               rtStatus = _FAIL;
+
        /*----Restore RFENV control type----*/;
-       switch (eRFPath) {
-       case RF_PATH_A:
-       case RF_PATH_C:
-               PHY_SetBBReg(Adapter, pPhyReg->rfintfs, bRFSI_RFENV, u4RegValue);
-               break;
-       case RF_PATH_B:
-       case RF_PATH_D:
-               PHY_SetBBReg(Adapter, pPhyReg->rfintfs, bRFSI_RFENV << 16, u4RegValue);
-               break;
-       }
+       PHY_SetBBReg(Adapter, pPhyReg->rfintfs, bRFSI_RFENV, u4RegValue);
+
        if (rtStatus != _SUCCESS)
                goto phy_RF6052_Config_ParaFile_Fail;