Commit 29c7dbbc authored by Michael Straube's avatar Michael Straube Committed by Greg Kroah-Hartman

staging: r8188eu: convert ODM_ReadAndConfig_MAC_REG_8188E() to int

The function ODM_ReadAndConfig_MAC_REG_8188E() has return type
'enum HAL_STATUS'. Convert the return type to int and use common
kernel error logic. Return 0 on success and negative values on
failure. The goal is to get rid of enum HAL_STATUS in the end.
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/20220928144323.13164-2-straube.linux@gmail.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 280f669b
...@@ -131,7 +131,7 @@ static void odm_ConfigMAC_8188E(struct odm_dm_struct *pDM_Odm, u32 Addr, u8 Data ...@@ -131,7 +131,7 @@ static void odm_ConfigMAC_8188E(struct odm_dm_struct *pDM_Odm, u32 Addr, u8 Data
rtw_write8(pDM_Odm->Adapter, Addr, Data); rtw_write8(pDM_Odm->Adapter, Addr, Data);
} }
enum HAL_STATUS ODM_ReadAndConfig_MAC_REG_8188E(struct odm_dm_struct *dm_odm) int ODM_ReadAndConfig_MAC_REG_8188E(struct odm_dm_struct *dm_odm)
{ {
#define READ_NEXT_PAIR(v1, v2, i) do { i += 2; v1 = array[i]; v2 = array[i + 1]; } while (0) #define READ_NEXT_PAIR(v1, v2, i) do { i += 2; v1 = array[i]; v2 = array[i + 1]; } while (0)
...@@ -144,7 +144,6 @@ enum HAL_STATUS ODM_ReadAndConfig_MAC_REG_8188E(struct odm_dm_struct *dm_odm) ...@@ -144,7 +144,6 @@ enum HAL_STATUS ODM_ReadAndConfig_MAC_REG_8188E(struct odm_dm_struct *dm_odm)
struct adapter *adapt = dm_odm->Adapter; struct adapter *adapt = dm_odm->Adapter;
struct xmit_frame *pxmit_frame = NULL; struct xmit_frame *pxmit_frame = NULL;
u8 bndy_cnt = 1; u8 bndy_cnt = 1;
enum HAL_STATUS rst = HAL_STATUS_SUCCESS;
hex += ODM_ITRF_USB << 8; hex += ODM_ITRF_USB << 8;
hex += ODM_CE << 16; hex += ODM_CE << 16;
hex += 0xFF000000; hex += 0xFF000000;
...@@ -155,7 +154,7 @@ enum HAL_STATUS ODM_ReadAndConfig_MAC_REG_8188E(struct odm_dm_struct *dm_odm) ...@@ -155,7 +154,7 @@ enum HAL_STATUS ODM_ReadAndConfig_MAC_REG_8188E(struct odm_dm_struct *dm_odm)
pxmit_frame = rtw_IOL_accquire_xmit_frame(adapt); pxmit_frame = rtw_IOL_accquire_xmit_frame(adapt);
if (!pxmit_frame) { if (!pxmit_frame) {
pr_info("rtw_IOL_accquire_xmit_frame failed\n"); pr_info("rtw_IOL_accquire_xmit_frame failed\n");
return HAL_STATUS_FAILURE; return -ENOMEM;
} }
} }
...@@ -206,8 +205,8 @@ enum HAL_STATUS ODM_ReadAndConfig_MAC_REG_8188E(struct odm_dm_struct *dm_odm) ...@@ -206,8 +205,8 @@ enum HAL_STATUS ODM_ReadAndConfig_MAC_REG_8188E(struct odm_dm_struct *dm_odm)
if (biol) { if (biol) {
if (!rtl8188e_IOL_exec_cmds_sync(dm_odm->Adapter, pxmit_frame, 1000, bndy_cnt)) { if (!rtl8188e_IOL_exec_cmds_sync(dm_odm->Adapter, pxmit_frame, 1000, bndy_cnt)) {
pr_info("~~~ MAC IOL_exec_cmds Failed !!!\n"); pr_info("~~~ MAC IOL_exec_cmds Failed !!!\n");
rst = HAL_STATUS_FAILURE; return -1;
} }
} }
return rst; return 0;
} }
...@@ -323,7 +323,7 @@ s32 PHY_MACConfig8188E(struct adapter *Adapter) ...@@ -323,7 +323,7 @@ s32 PHY_MACConfig8188E(struct adapter *Adapter)
/* */ /* */
/* Config MAC */ /* Config MAC */
/* */ /* */
if (HAL_STATUS_FAILURE == ODM_ReadAndConfig_MAC_REG_8188E(&pHalData->odmpriv)) if (ODM_ReadAndConfig_MAC_REG_8188E(&pHalData->odmpriv))
rtStatus = _FAIL; rtStatus = _FAIL;
/* 2010.07.13 AMPDU aggregation number B */ /* 2010.07.13 AMPDU aggregation number B */
......
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
/****************************************************************************** /******************************************************************************
* MAC_REG.TXT * MAC_REG.TXT
******************************************************************************/ ******************************************************************************/
int ODM_ReadAndConfig_MAC_REG_8188E(struct odm_dm_struct *pDM_Odm);
enum HAL_STATUS ODM_ReadAndConfig_MAC_REG_8188E(struct odm_dm_struct *pDM_Odm);
#endif /* end of HWIMG_SUPPORT */ #endif /* end of HWIMG_SUPPORT */
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