From: Michael Straube Date: Tue, 5 Apr 2022 10:49:08 +0000 (+0200) Subject: staging: r8188eu: remove HAL_DEF_IS_SUPPORT_ANT_DIV X-Git-Tag: v6.6.17~7348^2~223 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0b465150b3226e7b718c0e17aafb0269b53d3338;p=platform%2Fkernel%2Flinux-rpi.git staging: r8188eu: remove HAL_DEF_IS_SUPPORT_ANT_DIV In order to get rid of the function GetHalDefVar8188EUsb(), remove the HAL_DEF_IS_SUPPORT_ANT_DIV case from it and move the functionality into a new function. This is part of the ongoing effort to get rid of the unwanted hal layer. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220405104910.9769-3-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/r8188eu/core/rtw_cmd.c b/drivers/staging/r8188eu/core/rtw_cmd.c index ecd0488c439b..9b53b92c6795 100644 --- a/drivers/staging/r8188eu/core/rtw_cmd.c +++ b/drivers/staging/r8188eu/core/rtw_cmd.c @@ -1094,16 +1094,21 @@ static void antenna_select_wk_hdl(struct adapter *padapter, u8 antenna) } } +static bool rtw_antenna_diversity(struct adapter *adapter) +{ + struct hal_data_8188e *haldata = &adapter->haldata; + + return haldata->AntDivCfg != 0; +} + u8 rtw_antenna_select_cmd(struct adapter *padapter, u8 antenna, u8 enqueue) { struct cmd_obj *ph2c; struct drvextra_cmd_parm *pdrvextra_cmd_parm; struct cmd_priv *pcmdpriv = &padapter->cmdpriv; - u8 support_ant_div; u8 res = _SUCCESS; - GetHalDefVar8188EUsb(padapter, HAL_DEF_IS_SUPPORT_ANT_DIV, &support_ant_div); - if (!support_ant_div) + if (!rtw_antenna_diversity(padapter)) return res; if (enqueue) { diff --git a/drivers/staging/r8188eu/hal/usb_halinit.c b/drivers/staging/r8188eu/hal/usb_halinit.c index 21ab6881796e..ac4c9db03a50 100644 --- a/drivers/staging/r8188eu/hal/usb_halinit.c +++ b/drivers/staging/r8188eu/hal/usb_halinit.c @@ -1200,9 +1200,6 @@ void GetHalDefVar8188EUsb(struct adapter *Adapter, enum hal_def_variable eVariab struct hal_data_8188e *haldata = &Adapter->haldata; switch (eVariable) { - case HAL_DEF_IS_SUPPORT_ANT_DIV: - *((u8 *)pValue) = (haldata->AntDivCfg == 0) ? false : true; - break; case HAL_DEF_CURRENT_ANTENNA: *((u8 *)pValue) = haldata->CurAntenna; break; diff --git a/drivers/staging/r8188eu/include/hal_intf.h b/drivers/staging/r8188eu/include/hal_intf.h index e222ab89bfc5..6a80e517a7ad 100644 --- a/drivers/staging/r8188eu/include/hal_intf.h +++ b/drivers/staging/r8188eu/include/hal_intf.h @@ -28,7 +28,6 @@ enum hw_variables { }; enum hal_def_variable { - HAL_DEF_IS_SUPPORT_ANT_DIV, HAL_DEF_CURRENT_ANTENNA, HAL_DEF_DBG_DM_FUNC,/* for dbg */ };