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

staging: rtl8712: Change return values of r8712_setrfreg_cmd()

Change return values of function r8712_setrfreg_cmd from _SUCCESS/_FAIL
to 0/-ENOMEM respectively. 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 da8e8120
...@@ -259,7 +259,7 @@ void r8712_set_chplan_cmd(struct _adapter *padapter, int chplan) ...@@ -259,7 +259,7 @@ void r8712_set_chplan_cmd(struct _adapter *padapter, int chplan)
r8712_enqueue_cmd(pcmdpriv, ph2c); r8712_enqueue_cmd(pcmdpriv, ph2c);
} }
u8 r8712_setrfreg_cmd(struct _adapter *padapter, u8 offset, u32 val) int r8712_setrfreg_cmd(struct _adapter *padapter, u8 offset, u32 val)
{ {
struct cmd_obj *ph2c; struct cmd_obj *ph2c;
struct writeRF_parm *pwriterfparm; struct writeRF_parm *pwriterfparm;
...@@ -267,17 +267,17 @@ u8 r8712_setrfreg_cmd(struct _adapter *padapter, u8 offset, u32 val) ...@@ -267,17 +267,17 @@ u8 r8712_setrfreg_cmd(struct _adapter *padapter, u8 offset, u32 val)
ph2c = kmalloc(sizeof(*ph2c), GFP_ATOMIC); ph2c = kmalloc(sizeof(*ph2c), GFP_ATOMIC);
if (!ph2c) if (!ph2c)
return _FAIL; return -ENOMEM;
pwriterfparm = kmalloc(sizeof(*pwriterfparm), GFP_ATOMIC); pwriterfparm = kmalloc(sizeof(*pwriterfparm), GFP_ATOMIC);
if (!pwriterfparm) { if (!pwriterfparm) {
kfree(ph2c); kfree(ph2c);
return _FAIL; return -ENOMEM;
} }
init_h2fwcmd_w_parm_no_rsp(ph2c, pwriterfparm, GEN_CMD_CODE(_SetRFReg)); init_h2fwcmd_w_parm_no_rsp(ph2c, pwriterfparm, GEN_CMD_CODE(_SetRFReg));
pwriterfparm->offset = offset; pwriterfparm->offset = offset;
pwriterfparm->value = val; pwriterfparm->value = val;
r8712_enqueue_cmd(pcmdpriv, ph2c); r8712_enqueue_cmd(pcmdpriv, ph2c);
return _SUCCESS; return 0;
} }
u8 r8712_getrfreg_cmd(struct _adapter *padapter, u8 offset, u8 *pval) u8 r8712_getrfreg_cmd(struct _adapter *padapter, u8 offset, u8 *pval)
......
...@@ -721,7 +721,7 @@ void r8712_setopmode_cmd(struct _adapter *padapter, ...@@ -721,7 +721,7 @@ void r8712_setopmode_cmd(struct _adapter *padapter,
int r8712_setdatarate_cmd(struct _adapter *padapter, u8 *rateset); int r8712_setdatarate_cmd(struct _adapter *padapter, u8 *rateset);
void r8712_set_chplan_cmd(struct _adapter *padapter, int chplan); void r8712_set_chplan_cmd(struct _adapter *padapter, int chplan);
u8 r8712_getrfreg_cmd(struct _adapter *padapter, u8 offset, u8 *pval); u8 r8712_getrfreg_cmd(struct _adapter *padapter, u8 offset, u8 *pval);
u8 r8712_setrfreg_cmd(struct _adapter *padapter, u8 offset, u32 val); int r8712_setrfreg_cmd(struct _adapter *padapter, u8 offset, u32 val);
void r8712_addbareq_cmd(struct _adapter *padapter, u8 tid); void r8712_addbareq_cmd(struct _adapter *padapter, u8 tid);
void r8712_wdg_wk_cmd(struct _adapter *padapter); void r8712_wdg_wk_cmd(struct _adapter *padapter);
void r8712_survey_cmd_callback(struct _adapter *padapter, void r8712_survey_cmd_callback(struct _adapter *padapter,
......
...@@ -429,7 +429,7 @@ uint oid_rt_pro_rf_write_registry_hdl(struct oid_par_priv* ...@@ -429,7 +429,7 @@ uint oid_rt_pro_rf_write_registry_hdl(struct oid_par_priv*
return RNDIS_STATUS_NOT_ACCEPTED; return RNDIS_STATUS_NOT_ACCEPTED;
if (poid_par_priv->information_buf_len == if (poid_par_priv->information_buf_len ==
(sizeof(unsigned long) * 3)) { (sizeof(unsigned long) * 3)) {
if (!r8712_setrfreg_cmd(Adapter, if (r8712_setrfreg_cmd(Adapter,
*(unsigned char *)poid_par_priv->information_buf, *(unsigned char *)poid_par_priv->information_buf,
(unsigned long)(*((unsigned long *) (unsigned long)(*((unsigned long *)
poid_par_priv->information_buf + 2)))) poid_par_priv->information_buf + 2))))
......
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