[PATCH 6/6] staging: r8188eu: remove init_default_value from hal_ops

From: Michael Straube
Date: Sat Sep 04 2021 - 08:41:09 EST


Remove init_default_value from hal_ops and remove its wrapper
rtw_hal_def_value_init(). Call rtl8188eu_init_default_value()
directly instead

Signed-off-by: Michael Straube <straube.linux@xxxxxxxxx>
---
drivers/staging/r8188eu/hal/hal_intf.c | 6 ------
drivers/staging/r8188eu/hal/usb_halinit.c | 4 +---
drivers/staging/r8188eu/include/hal_intf.h | 5 +----
drivers/staging/r8188eu/os_dep/os_intfs.c | 4 ++--
4 files changed, 4 insertions(+), 15 deletions(-)

diff --git a/drivers/staging/r8188eu/hal/hal_intf.c b/drivers/staging/r8188eu/hal/hal_intf.c
index 9069b52f83ff..c06b299cf266 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_def_value_init(struct adapter *adapt)
-{
- if (adapt->HalFunc.init_default_value)
- adapt->HalFunc.init_default_value(adapt);
-}
-
void rtw_hal_free_data(struct adapter *adapt)
{
if (adapt->HalFunc.free_hal_data)
diff --git a/drivers/staging/r8188eu/hal/usb_halinit.c b/drivers/staging/r8188eu/hal/usb_halinit.c
index d34d26de69d9..679f9f6e6dbe 100644
--- a/drivers/staging/r8188eu/hal/usb_halinit.c
+++ b/drivers/staging/r8188eu/hal/usb_halinit.c
@@ -2196,7 +2196,7 @@ static void SetBeaconRelatedRegisters8188EUsb(struct adapter *adapt)
rtw_write8(adapt, bcn_ctrl_reg, rtw_read8(adapt, bcn_ctrl_reg) | BIT(1));
}

-static void rtl8188eu_init_default_value(struct adapter *adapt)
+void rtl8188eu_init_default_value(struct adapter *adapt)
{
struct hal_data_8188e *haldata;
struct pwrctrl_priv *pwrctrlpriv;
@@ -2249,8 +2249,6 @@ void rtl8188eu_set_hal_ops(struct adapter *adapt)
halfunc->InitSwLeds = &rtl8188eu_InitSwLeds;
halfunc->DeInitSwLeds = &rtl8188eu_DeInitSwLeds;

- halfunc->init_default_value = &rtl8188eu_init_default_value;
-
halfunc->SetHwRegHandler = &SetHwReg8188EU;
halfunc->GetHwRegHandler = &GetHwReg8188EU;
halfunc->GetHalDefVarHandler = &GetHalDefVar8188EUsb;
diff --git a/drivers/staging/r8188eu/include/hal_intf.h b/drivers/staging/r8188eu/include/hal_intf.h
index d5cf9b0d9a77..b3ea9fc041c6 100644
--- a/drivers/staging/r8188eu/include/hal_intf.h
+++ b/drivers/staging/r8188eu/include/hal_intf.h
@@ -149,8 +149,6 @@ struct hal_ops {
void (*dm_init)(struct adapter *padapter);
void (*dm_deinit)(struct adapter *padapter);

- void (*init_default_value)(struct adapter *padapter);
-
void (*enable_interrupt)(struct adapter *padapter);
void (*disable_interrupt)(struct adapter *padapter);
s32 (*interrupt_handler)(struct adapter *padapter);
@@ -262,8 +260,7 @@ void rtl8188eu_set_hal_ops(struct adapter *padapter);

void rtl8188eu_interface_configure(struct adapter *adapt);
void ReadAdapterInfo8188EU(struct adapter *Adapter);
-
-void rtw_hal_def_value_init(struct adapter *padapter);
+void rtl8188eu_init_default_value(struct adapter *adapt);

void rtw_hal_free_data(struct adapter *padapter);

diff --git a/drivers/staging/r8188eu/os_dep/os_intfs.c b/drivers/staging/r8188eu/os_dep/os_intfs.c
index c3ac0ae153f8..49ccdde1b0bb 100644
--- a/drivers/staging/r8188eu/os_dep/os_intfs.c
+++ b/drivers/staging/r8188eu/os_dep/os_intfs.c
@@ -782,7 +782,7 @@ static u8 rtw_init_default_value(struct adapter *padapter)
rtw_update_registrypriv_dev_network(padapter);

/* hal_priv */
- rtw_hal_def_value_init(padapter);
+ rtl8188eu_init_default_value(padapter);

/* misc. */
padapter->bReadPortCancel = false;
@@ -801,7 +801,7 @@ u8 rtw_reset_drv_sw(struct adapter *padapter)
struct pwrctrl_priv *pwrctrlpriv = &padapter->pwrctrlpriv;

/* hal_priv */
- rtw_hal_def_value_init(padapter);
+ rtl8188eu_init_default_value(padapter);
padapter->bReadPortCancel = false;
padapter->bWritePortCancel = false;
padapter->bRxRSSIDisplay = 0;
--
2.33.0