[PATCH v2 3/7] staging: r8188eu: drop unnecessary wrapper _rtw_init_evt_priv
From: Vihas Makwana
Date: Mon Apr 11 2022 - 06:24:06 EST
Drop unnecessary wrapper _rtw_init_evt_priv and move its logic to
rtw_init_evt_priv.
Signed-off-by: Vihas Makwana <makvihas@xxxxxxxxx>
---
drivers/staging/r8188eu/core/rtw_cmd.c | 27 +++++++++-----------------
1 file changed, 9 insertions(+), 18 deletions(-)
diff --git a/drivers/staging/r8188eu/core/rtw_cmd.c b/drivers/staging/r8188eu/core/rtw_cmd.c
index 3d1fdc852..3781706f7 100644
--- a/drivers/staging/r8188eu/core/rtw_cmd.c
+++ b/drivers/staging/r8188eu/core/rtw_cmd.c
@@ -17,22 +17,6 @@
static void c2h_wk_callback(struct work_struct *work);
-static int _rtw_init_evt_priv(struct evt_priv *pevtpriv)
-{
- int res = _SUCCESS;
-
- /* allocate DMA-able/Non-Page memory for cmd_buf and rsp_buf */
- atomic_set(&pevtpriv->event_seq, 0);
-
- INIT_WORK(&pevtpriv->c2h_wk, c2h_wk_callback);
- pevtpriv->c2h_wk_alive = false;
- pevtpriv->c2h_queue = rtw_cbuf_alloc(C2H_QUEUE_MAX_LEN + 1);
- if (!pevtpriv->c2h_queue)
- res = _FAIL;
-
- return res;
-}
-
void rtw_free_evt_priv(struct evt_priv *pevtpriv)
{
cancel_work_sync(&pevtpriv->c2h_wk);
@@ -133,9 +117,16 @@ u32 rtw_init_cmd_priv(struct cmd_priv *pcmdpriv)
u32 rtw_init_evt_priv(struct evt_priv *pevtpriv)
{
- int res;
+ u32 res = _SUCCESS;
+
+ /* allocate DMA-able/Non-Page memory for cmd_buf and rsp_buf */
+ atomic_set(&pevtpriv->event_seq, 0);
- res = _rtw_init_evt_priv(pevtpriv);
+ INIT_WORK(&pevtpriv->c2h_wk, c2h_wk_callback);
+ pevtpriv->c2h_wk_alive = false;
+ pevtpriv->c2h_queue = rtw_cbuf_alloc(C2H_QUEUE_MAX_LEN + 1);
+ if (!pevtpriv->c2h_queue)
+ res = _FAIL;
return res;
}
--
2.30.2