From: Michael Straube Date: Fri, 17 Sep 2021 08:06:15 +0000 (+0200) Subject: staging: r8188eu: remove switches from phy_RF6052_Config_ParaFile() X-Git-Tag: v6.6.17~8914^2~373 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fc7e745c3588ddd7c14d8392429736c9f8c0451f;p=platform%2Fkernel%2Flinux-rpi.git staging: r8188eu: remove switches from phy_RF6052_Config_ParaFile() 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 Link: https://lore.kernel.org/r/20210917080615.25819-5-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/r8188eu/hal/rtl8188e_rf6052.c b/drivers/staging/r8188eu/hal/rtl8188e_rf6052.c index 63e8505..2f16c09 100644 --- a/drivers/staging/r8188eu/hal/rtl8188e_rf6052.c +++ b/drivers/staging/r8188eu/hal/rtl8188e_rf6052.c @@ -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;