staging: rtl8712: Change return values in r8712_init_cmd_priv()

Change return values in r8712_init_cmd_priv from _SUCCESS/_FAIL to
0/-ENOMEM. Modify call site accordingly.

Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Nishka Dasgupta 2019-06-24 11:18:54 +05:30 committed by Greg Kroah-Hartman
parent 4a808fa3aa
commit d91674322d
2 changed files with 4 additions and 4 deletions

View File

@ -297,7 +297,7 @@ static u8 init_default_value(struct _adapter *padapter)
u8 r8712_init_drv_sw(struct _adapter *padapter) u8 r8712_init_drv_sw(struct _adapter *padapter)
{ {
if ((r8712_init_cmd_priv(&padapter->cmdpriv)) == _FAIL) if (r8712_init_cmd_priv(&padapter->cmdpriv))
return _FAIL; return _FAIL;
padapter->cmdpriv.padapter = padapter; padapter->cmdpriv.padapter = padapter;
if ((r8712_init_evt_priv(&padapter->evtpriv)) == _FAIL) if ((r8712_init_evt_priv(&padapter->evtpriv)) == _FAIL)

View File

@ -55,7 +55,7 @@ int r8712_init_cmd_priv(struct cmd_priv *pcmdpriv)
pcmdpriv->cmd_allocated_buf = kmalloc(MAX_CMDSZ + CMDBUFF_ALIGN_SZ, pcmdpriv->cmd_allocated_buf = kmalloc(MAX_CMDSZ + CMDBUFF_ALIGN_SZ,
GFP_ATOMIC); GFP_ATOMIC);
if (!pcmdpriv->cmd_allocated_buf) if (!pcmdpriv->cmd_allocated_buf)
return _FAIL; return -ENOMEM;
pcmdpriv->cmd_buf = pcmdpriv->cmd_allocated_buf + CMDBUFF_ALIGN_SZ - pcmdpriv->cmd_buf = pcmdpriv->cmd_allocated_buf + CMDBUFF_ALIGN_SZ -
((addr_t)(pcmdpriv->cmd_allocated_buf) & ((addr_t)(pcmdpriv->cmd_allocated_buf) &
(CMDBUFF_ALIGN_SZ - 1)); (CMDBUFF_ALIGN_SZ - 1));
@ -63,14 +63,14 @@ int r8712_init_cmd_priv(struct cmd_priv *pcmdpriv)
if (!pcmdpriv->rsp_allocated_buf) { if (!pcmdpriv->rsp_allocated_buf) {
kfree(pcmdpriv->cmd_allocated_buf); kfree(pcmdpriv->cmd_allocated_buf);
pcmdpriv->cmd_allocated_buf = NULL; pcmdpriv->cmd_allocated_buf = NULL;
return _FAIL; return -ENOMEM;
} }
pcmdpriv->rsp_buf = pcmdpriv->rsp_allocated_buf + 4 - pcmdpriv->rsp_buf = pcmdpriv->rsp_allocated_buf + 4 -
((addr_t)(pcmdpriv->rsp_allocated_buf) & 3); ((addr_t)(pcmdpriv->rsp_allocated_buf) & 3);
pcmdpriv->cmd_issued_cnt = 0; pcmdpriv->cmd_issued_cnt = 0;
pcmdpriv->cmd_done_cnt = 0; pcmdpriv->cmd_done_cnt = 0;
pcmdpriv->rsp_cnt = 0; pcmdpriv->rsp_cnt = 0;
return _SUCCESS; return 0;
} }
static sint _init_evt_priv(struct evt_priv *pevtpriv) static sint _init_evt_priv(struct evt_priv *pevtpriv)