From: Michael Straube <straube.linux@gmail.com> Date: Mon, 6 Sep 2021 19:02:20 +0000 (+0200) Subject: staging: r8188eu: remove free_hal_data from hal_ops X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=c5b46f7647b94afbd9ec6431edf63064aa2996c6;p=linux.git staging: r8188eu: remove free_hal_data from hal_ops Remove free_hal_data from hal_ops and remove its wrapper rtw_hal_free_data(). Call rtl8188e_free_hal_data() directly instead. Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20210906190223.11396-38-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> --- diff --git a/drivers/staging/r8188eu/hal/hal_intf.c b/drivers/staging/r8188eu/hal/hal_intf.c index 4394c6825f1ad..17ac271e2417a 100644 --- a/drivers/staging/r8188eu/hal/hal_intf.c +++ b/drivers/staging/r8188eu/hal/hal_intf.c @@ -6,12 +6,6 @@ #include "../include/drv_types.h" #include "../include/hal_intf.h" -void rtw_hal_free_data(struct adapter *adapt) -{ - if (adapt->HalFunc.free_hal_data) - adapt->HalFunc.free_hal_data(adapt); -} - uint rtw_hal_init(struct adapter *adapt) { uint status = _SUCCESS; diff --git a/drivers/staging/r8188eu/hal/rtl8188e_hal_init.c b/drivers/staging/r8188eu/hal/rtl8188e_hal_init.c index 9a76e9aaa2d0f..22750cd40d45a 100644 --- a/drivers/staging/r8188eu/hal/rtl8188e_hal_init.c +++ b/drivers/staging/r8188eu/hal/rtl8188e_hal_init.c @@ -669,12 +669,10 @@ void rtl8188e_InitializeFirmwareVars(struct adapter *padapter) pHalData->LastHMEBoxNum = 0; } -static void rtl8188e_free_hal_data(struct adapter *padapter) +void rtl8188e_free_hal_data(struct adapter *padapter) { - kfree(padapter->HalData); padapter->HalData = NULL; - } /* */ @@ -1760,8 +1758,6 @@ void hal_notch_filter_8188e(struct adapter *adapter, bool enable) } void rtl8188e_set_hal_ops(struct hal_ops *pHalFunc) { - pHalFunc->free_hal_data = &rtl8188e_free_hal_data; - pHalFunc->read_bbreg = &rtl8188e_PHY_QueryBBReg; pHalFunc->write_bbreg = &rtl8188e_PHY_SetBBReg; pHalFunc->read_rfreg = &rtl8188e_PHY_QueryRFReg; diff --git a/drivers/staging/r8188eu/include/hal_intf.h b/drivers/staging/r8188eu/include/hal_intf.h index 35201286704f9..9b0a44659f57d 100644 --- a/drivers/staging/r8188eu/include/hal_intf.h +++ b/drivers/staging/r8188eu/include/hal_intf.h @@ -127,8 +127,6 @@ struct hal_ops { u32 (*hal_init)(struct adapter *padapter); u32 (*hal_deinit)(struct adapter *padapter); - void (*free_hal_data)(struct adapter *padapter); - u32 (*inirp_init)(struct adapter *padapter); u32 (*inirp_deinit)(struct adapter *padapter); @@ -194,7 +192,7 @@ void rtl8188eu_init_default_value(struct adapter *adapt); void rtl8188e_SetHalODMVar(struct adapter *Adapter, enum hal_odm_variable eVariable, void *pValue1, bool bSet); u32 rtl8188eu_InitPowerOn(struct adapter *adapt); - +void rtl8188e_free_hal_data(struct adapter *padapter); void rtl8188e_EfusePowerSwitch(struct adapter *pAdapter, u8 bWrite, u8 PwrState); void rtl8188e_ReadEFuse(struct adapter *Adapter, u8 efuseType, u16 _offset, u16 _size_byte, u8 *pbuf, @@ -207,7 +205,6 @@ int rtl8188e_Efuse_PgPacketWrite(struct adapter *pAdapter, u8 offset, u8 word_en void hal_notch_filter_8188e(struct adapter *adapter, bool enable); -void rtw_hal_free_data(struct adapter *padapter); uint rtw_hal_init(struct adapter *padapter); uint rtw_hal_deinit(struct adapter *padapter); void rtw_hal_stop(struct adapter *padapter); diff --git a/drivers/staging/r8188eu/os_dep/os_intfs.c b/drivers/staging/r8188eu/os_dep/os_intfs.c index 361d4b75cd6d4..a1136c0dadf71 100644 --- a/drivers/staging/r8188eu/os_dep/os_intfs.c +++ b/drivers/staging/r8188eu/os_dep/os_intfs.c @@ -946,7 +946,7 @@ u8 rtw_free_drv_sw(struct adapter *padapter) rtw_free_pwrctrl_priv(padapter); - rtw_hal_free_data(padapter); + rtl8188e_free_hal_data(padapter); /* free the old_pnetdev */ if (padapter->rereg_nd_name_priv.old_pnetdev) {