[1/4] staging: r8188eu: convert PHY_MACConfig8188E() to common error logic
Commit Message
Convert the function PHY_MACConfig8188E() 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: Michael Straube <straube.linux@gmail.com>
---
drivers/staging/r8188eu/hal/rtl8188e_phycfg.c | 9 ++++-----
drivers/staging/r8188eu/hal/usb_halinit.c | 5 ++---
2 files changed, 6 insertions(+), 8 deletions(-)
@@ -315,21 +315,20 @@ rtl8188e_PHY_SetRFReg(
* 08/12/2008 MHC Create Version 0.
*
*---------------------------------------------------------------------------*/
-s32 PHY_MACConfig8188E(struct adapter *Adapter)
+int PHY_MACConfig8188E(struct adapter *Adapter)
{
struct hal_data_8188e *pHalData = &Adapter->haldata;
- int rtStatus = _SUCCESS;
+ int err;
/* */
/* Config MAC */
/* */
- if (ODM_ReadAndConfig_MAC_REG_8188E(&pHalData->odmpriv))
- rtStatus = _FAIL;
+ err = ODM_ReadAndConfig_MAC_REG_8188E(&pHalData->odmpriv);
/* 2010.07.13 AMPDU aggregation number B */
rtw_write16(Adapter, REG_MAX_AGGR_NUM, MAX_AGGR_NUM);
- return rtStatus;
+ return err;
}
/**
@@ -600,9 +600,8 @@ u32 rtl8188eu_hal_init(struct adapter *Adapter)
Adapter->pwrctrlpriv.bFwCurrentInPSMode = false;
haldata->LastHMEBoxNum = 0;
- status = PHY_MACConfig8188E(Adapter);
- if (status == _FAIL)
- goto exit;
+ if (PHY_MACConfig8188E(Adapter))
+ return _FAIL;
/* */
/* d. Initialize BB related configurations. */