Commit d9167432 authored by Nishka Dasgupta's avatar Nishka Dasgupta Committed by Greg Kroah-Hartman

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: default avatarNishka Dasgupta <nishkadg.linux@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 4a808fa3
...@@ -297,7 +297,7 @@ static u8 init_default_value(struct _adapter *padapter) ...@@ -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)
......
...@@ -55,7 +55,7 @@ int r8712_init_cmd_priv(struct cmd_priv *pcmdpriv) ...@@ -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) ...@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment