Commit 4193769b authored by Michael Straube's avatar Michael Straube Committed by Greg Kroah-Hartman

staging: r8188eu: convert PHY_BBConfig8188E() to common error logic

Convert the function PHY_BBConfig8188E() away from returning _FAIL or
_SUCCESS which uses inverted error logic. Use the common error logic
instead. Return 0 for success and negative values for failure.
Signed-off-by: default avatarMichael Straube <straube.linux@gmail.com>
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Link: https://lore.kernel.org/r/20230115210734.18610-5-straube.linux@gmail.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent c58bc596
...@@ -478,18 +478,17 @@ PHY_BBConfig8188E( ...@@ -478,18 +478,17 @@ PHY_BBConfig8188E(
struct adapter *Adapter struct adapter *Adapter
) )
{ {
int rtStatus = _SUCCESS;
struct hal_data_8188e *pHalData = &Adapter->haldata; struct hal_data_8188e *pHalData = &Adapter->haldata;
u16 RegVal; u16 RegVal;
u8 CrystalCap; u8 CrystalCap;
int res; int err;
phy_InitBBRFRegisterDefinition(Adapter); phy_InitBBRFRegisterDefinition(Adapter);
/* Enable BB and RF */ /* Enable BB and RF */
res = rtw_read16(Adapter, REG_SYS_FUNC_EN, &RegVal); err = rtw_read16(Adapter, REG_SYS_FUNC_EN, &RegVal);
if (res) if (err)
return _FAIL; return err;
rtw_write16(Adapter, REG_SYS_FUNC_EN, (u16)(RegVal | BIT(13) | BIT(0) | BIT(1))); rtw_write16(Adapter, REG_SYS_FUNC_EN, (u16)(RegVal | BIT(13) | BIT(0) | BIT(1)));
...@@ -500,14 +499,13 @@ PHY_BBConfig8188E( ...@@ -500,14 +499,13 @@ PHY_BBConfig8188E(
rtw_write8(Adapter, REG_SYS_FUNC_EN, FEN_USBA | FEN_USBD | FEN_BB_GLB_RSTn | FEN_BBRSTB); rtw_write8(Adapter, REG_SYS_FUNC_EN, FEN_USBA | FEN_USBD | FEN_BB_GLB_RSTn | FEN_BBRSTB);
/* Config BB and AGC */ /* Config BB and AGC */
if (phy_BB8188E_Config_ParaFile(Adapter)) err = phy_BB8188E_Config_ParaFile(Adapter);
rtStatus = _FAIL;
/* write 0x24[16:11] = 0x24[22:17] = CrystalCap */ /* write 0x24[16:11] = 0x24[22:17] = CrystalCap */
CrystalCap = pHalData->CrystalCap & 0x3F; CrystalCap = pHalData->CrystalCap & 0x3F;
rtl8188e_PHY_SetBBReg(Adapter, REG_AFE_XTAL_CTRL, 0x7ff800, (CrystalCap | (CrystalCap << 6))); rtl8188e_PHY_SetBBReg(Adapter, REG_AFE_XTAL_CTRL, 0x7ff800, (CrystalCap | (CrystalCap << 6)));
return rtStatus; return err;
} }
static void getTxPowerIndex88E(struct adapter *Adapter, u8 channel, u8 *cckPowerLevel, static void getTxPowerIndex88E(struct adapter *Adapter, u8 channel, u8 *cckPowerLevel,
......
...@@ -606,9 +606,8 @@ u32 rtl8188eu_hal_init(struct adapter *Adapter) ...@@ -606,9 +606,8 @@ u32 rtl8188eu_hal_init(struct adapter *Adapter)
/* */ /* */
/* d. Initialize BB related configurations. */ /* d. Initialize BB related configurations. */
/* */ /* */
status = PHY_BBConfig8188E(Adapter); if (PHY_BBConfig8188E(Adapter))
if (status == _FAIL) return _FAIL;
goto exit;
if (phy_RF6052_Config_ParaFile(Adapter)) if (phy_RF6052_Config_ParaFile(Adapter))
return _FAIL; return _FAIL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment