From: Martin Kaiser Date: Sat, 8 Jan 2022 12:49:59 +0000 (+0100) Subject: staging: r8188eu: we always enqueue in rtw_set_chplan_cmd X-Git-Tag: v6.6.17~7876^2~407 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c87c2b0d3ed07ef0f796cbba1037934111fb3c12;p=platform%2Fkernel%2Flinux-rpi.git staging: r8188eu: we always enqueue in rtw_set_chplan_cmd The only caller of rtw_set_chplan_cmd requests that the message be enqueued and not sent directly. Remove the enqueue parameter and the code for direct sending. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220108124959.313215-13-martin@kaiser.cx 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 712fd6e..3d22a88 100644 --- a/drivers/staging/r8188eu/core/rtw_cmd.c +++ b/drivers/staging/r8188eu/core/rtw_cmd.c @@ -836,7 +836,7 @@ exit: return res; } -u8 rtw_set_chplan_cmd(struct adapter *padapter, u8 chplan, u8 enqueue) +u8 rtw_set_chplan_cmd(struct adapter *padapter, u8 chplan) { struct cmd_obj *pcmdobj; struct SetChannelPlan_param *setChannelPlan_param; @@ -859,25 +859,17 @@ u8 rtw_set_chplan_cmd(struct adapter *padapter, u8 chplan, u8 enqueue) } setChannelPlan_param->channel_plan = chplan; - if (enqueue) { - /* need enqueue, prepare cmd_obj and enqueue */ - pcmdobj = kzalloc(sizeof(struct cmd_obj), GFP_KERNEL); - if (!pcmdobj) { - kfree(setChannelPlan_param); - res = _FAIL; - goto exit; - } - - init_h2fwcmd_w_parm_no_rsp(pcmdobj, setChannelPlan_param, GEN_CMD_CODE(_SetChannelPlan)); - res = rtw_enqueue_cmd(pcmdpriv, pcmdobj); - } else { - /* no need to enqueue, do the cmd hdl directly and free cmd parameter */ - if (H2C_SUCCESS != set_chplan_hdl(padapter, (unsigned char *)setChannelPlan_param)) - res = _FAIL; - + /* need enqueue, prepare cmd_obj and enqueue */ + pcmdobj = kzalloc(sizeof(struct cmd_obj), GFP_KERNEL); + if (!pcmdobj) { kfree(setChannelPlan_param); + res = _FAIL; + goto exit; } + init_h2fwcmd_w_parm_no_rsp(pcmdobj, setChannelPlan_param, GEN_CMD_CODE(_SetChannelPlan)); + res = rtw_enqueue_cmd(pcmdpriv, pcmdobj); + /* do something based on res... */ if (res == _SUCCESS) padapter->mlmepriv.ChannelPlan = chplan; diff --git a/drivers/staging/r8188eu/include/rtw_cmd.h b/drivers/staging/r8188eu/include/rtw_cmd.h index cf0945a..60cecdd 100644 --- a/drivers/staging/r8188eu/include/rtw_cmd.h +++ b/drivers/staging/r8188eu/include/rtw_cmd.h @@ -772,7 +772,7 @@ u8 rtw_ps_cmd(struct adapter*padapter); u8 rtw_chk_hi_queue_cmd(struct adapter*padapter); -u8 rtw_set_chplan_cmd(struct adapter*padapter, u8 chplan, u8 enqueue); +u8 rtw_set_chplan_cmd(struct adapter *padapter, u8 chplan); u8 rtw_c2h_wk_cmd(struct adapter *padapter, u8 *c2h_evt); diff --git a/drivers/staging/r8188eu/os_dep/ioctl_linux.c b/drivers/staging/r8188eu/os_dep/ioctl_linux.c index 41b4578..b9f9698 100644 --- a/drivers/staging/r8188eu/os_dep/ioctl_linux.c +++ b/drivers/staging/r8188eu/os_dep/ioctl_linux.c @@ -2098,7 +2098,7 @@ static int rtw_wx_set_channel_plan(struct net_device *dev, struct mlme_priv *pmlmepriv = &padapter->mlmepriv; u8 channel_plan_req = (u8)(*((int *)wrqu)); - if (_SUCCESS == rtw_set_chplan_cmd(padapter, channel_plan_req, 1)) + if (_SUCCESS == rtw_set_chplan_cmd(padapter, channel_plan_req)) DBG_88E("%s set channel_plan = 0x%02X\n", __func__, pmlmepriv->ChannelPlan); else return -EPERM;