[PATCH 9/9] staging: r8188eu: merge ODM_ConfigBBWithHeaderFile with its callers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
---
 drivers/staging/r8188eu/hal/odm_HWConfig.c     | 15 ---------------
 drivers/staging/r8188eu/hal/rtl8188e_phycfg.c  |  8 +++-----
 drivers/staging/r8188eu/include/odm_HWConfig.h |  3 ---
 3 files changed, 3 insertions(+), 23 deletions(-)

diff --git a/drivers/staging/r8188eu/hal/odm_HWConfig.c b/drivers/staging/r8188eu/hal/odm_HWConfig.c
index 1c3074fc6be4..dcc38b036280 100644
--- a/drivers/staging/r8188eu/hal/odm_HWConfig.c
+++ b/drivers/staging/r8188eu/hal/odm_HWConfig.c
@@ -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;
-}
diff --git a/drivers/staging/r8188eu/hal/rtl8188e_phycfg.c b/drivers/staging/r8188eu/hal/rtl8188e_phycfg.c
index 15370b674e53..0b0690dfb947 100644
--- a/drivers/staging/r8188eu/hal/rtl8188e_phycfg.c
+++ b/drivers/staging/r8188eu/hal/rtl8188e_phycfg.c
@@ -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)
diff --git a/drivers/staging/r8188eu/include/odm_HWConfig.h b/drivers/staging/r8188eu/include/odm_HWConfig.h
index 1bd6f254bf53..b37962edb2ed 100644
--- a/drivers/staging/r8188eu/include/odm_HWConfig.h
+++ b/drivers/staging/r8188eu/include/odm_HWConfig.h
@@ -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
-- 
2.30.2





[Index of Archives]     [Linux Driver Development]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux