staging: r8188eu: merge ODM_ConfigBBWithHeaderFile with its callers
authorMartin Kaiser <martin@kaiser.cx>
Mon, 10 Jan 2022 12:46:38 +0000 (13:46 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 25 Jan 2022 15:18:42 +0000 (16:18 +0100)
ODM_ConfigBBWithHeaderFile is a "multiplexer" for ODM_ReadAndConfig_...
functions. It's called only from phy_BB8188E_Config_ParaFile.

We can remove ODM_ConfigBBWithHeaderFile and call the
ODM_ReadAndConfig_... functions directly.

ODM_ReadAndConfig_PHY_REG_PG_8188E does not return an error status,
there's no need for a check.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220110124638.6909-10-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/r8188eu/hal/odm_HWConfig.c
drivers/staging/r8188eu/hal/rtl8188e_phycfg.c
drivers/staging/r8188eu/include/odm_HWConfig.h

index 1c3074fc6be49206cf0c4fc3039e9f1e2748a083..dcc38b0362800c17dd99c6b900f48c743400480a 100644 (file)
@@ -362,18 +362,3 @@ enum HAL_STATUS ODM_ConfigRFWithHeaderFile(struct odm_dm_struct *dm_odm)
 {
        return ODM_ReadAndConfig_RadioA_1T_8188E(dm_odm);
 }
-
-enum HAL_STATUS ODM_ConfigBBWithHeaderFile(struct odm_dm_struct *dm_odm,
-                                          enum odm_bb_config_type config_tp)
-{
-       if (config_tp == CONFIG_BB_PHY_REG) {
-               return ODM_ReadAndConfig_PHY_REG_1T_8188E(dm_odm);
-       } else if (config_tp == CONFIG_BB_AGC_TAB) {
-               return ODM_ReadAndConfig_AGC_TAB_1T_8188E(dm_odm);
-       } else if (config_tp == CONFIG_BB_PHY_REG_PG) {
-               ODM_ReadAndConfig_PHY_REG_PG_8188E(dm_odm);
-               return HAL_STATUS_SUCCESS;
-       }
-
-       return HAL_STATUS_FAILURE;
-}
index 15370b674e5344caff808c8de5eb5cff262c5c93..0b0690dfb947c13df0e70bdc9ccbe8d983f09e5d 100644 (file)
@@ -493,7 +493,7 @@ static      int phy_BB8188E_Config_ParaFile(struct adapter *Adapter)
        /*  1. Read PHY_REG.TXT BB INIT!! */
        /*  We will separate as 88C / 92C according to chip version */
        /*  */
-       if (HAL_STATUS_FAILURE == ODM_ConfigBBWithHeaderFile(&pHalData->odmpriv, CONFIG_BB_PHY_REG))
+       if (HAL_STATUS_FAILURE == ODM_ReadAndConfig_PHY_REG_1T_8188E(&pHalData->odmpriv))
                rtStatus = _FAIL;
        if (rtStatus != _SUCCESS)
                goto phy_BB8190_Config_ParaFile_Fail;
@@ -501,16 +501,14 @@ static    int phy_BB8188E_Config_ParaFile(struct adapter *Adapter)
        /*  2. If EEPROM or EFUSE autoload OK, We must config by PHY_REG_PG.txt */
        if (!pEEPROM->bautoload_fail_flag) {
                pHalData->pwrGroupCnt = 0;
-
-               if (HAL_STATUS_FAILURE == ODM_ConfigBBWithHeaderFile(&pHalData->odmpriv, CONFIG_BB_PHY_REG_PG))
-                       rtStatus = _FAIL;
+               ODM_ReadAndConfig_PHY_REG_PG_8188E(&pHalData->odmpriv);
        }
 
        if (rtStatus != _SUCCESS)
                goto phy_BB8190_Config_ParaFile_Fail;
 
        /*  3. BB AGC table Initialization */
-       if (HAL_STATUS_FAILURE == ODM_ConfigBBWithHeaderFile(&pHalData->odmpriv,  CONFIG_BB_AGC_TAB))
+       if (HAL_STATUS_FAILURE == ODM_ReadAndConfig_AGC_TAB_1T_8188E(&pHalData->odmpriv))
                rtStatus = _FAIL;
 
        if (rtStatus != _SUCCESS)
index 1bd6f254bf53c73698194d0504e767277c127971..b37962edb2edebaa675a8d2978eacce9ef7b66a6 100644 (file)
@@ -67,7 +67,4 @@ void ODM_PhyStatusQuery(struct odm_dm_struct *pDM_Odm,
                        struct adapter *adapt);
 
 enum HAL_STATUS ODM_ConfigRFWithHeaderFile(struct odm_dm_struct *pDM_Odm);
-
-enum HAL_STATUS ODM_ConfigBBWithHeaderFile(struct odm_dm_struct *pDM_Odm,
-                                          enum odm_bb_config_type ConfigType);
 #endif