staging: r8188eu: convert PHY_MACConfig8188E() to common error logic
authorMichael Straube <straube.linux@gmail.com>
Sun, 15 Jan 2023 21:07:31 +0000 (22:07 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 17 Jan 2023 18:39:02 +0000 (19:39 +0100)
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>
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Link: https://lore.kernel.org/r/20230115210734.18610-2-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/r8188eu/hal/rtl8188e_phycfg.c
drivers/staging/r8188eu/hal/usb_halinit.c

index b7f3c7a..204c1c3 100644 (file)
@@ -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;
 }
 
 /**
index d28b4dc..9ba6a52 100644 (file)
@@ -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. */