diff options
author | Nishka Dasgupta <nishkadg.linux@gmail.com> | 2019-06-24 11:19:03 +0530 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-06-26 10:00:09 +0800 |
commit | a5dedb5c98df60d931a05e711f60ad4fd94a2dc0 (patch) | |
tree | ede3de396fde01f48c23c9855f513bf1f5fd7acd /drivers/staging | |
parent | da8e81205e8f8eafebcffabbe10536371a0c4baa (diff) | |
download | linux-a5dedb5c98df60d931a05e711f60ad4fd94a2dc0.tar.bz2 |
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: Nishka Dasgupta <nishkadg.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging')
-rw-r--r-- | drivers/staging/rtl8712/rtl871x_cmd.c | 8 | ||||
-rw-r--r-- | drivers/staging/rtl8712/rtl871x_cmd.h | 2 | ||||
-rw-r--r-- | drivers/staging/rtl8712/rtl871x_ioctl_rtl.c | 2 |
3 files changed, 6 insertions, 6 deletions
diff --git a/drivers/staging/rtl8712/rtl871x_cmd.c b/drivers/staging/rtl8712/rtl871x_cmd.c index 8af1574e7753..cfd09718777f 100644 --- a/drivers/staging/rtl8712/rtl871x_cmd.c +++ b/drivers/staging/rtl8712/rtl871x_cmd.c @@ -259,7 +259,7 @@ void r8712_set_chplan_cmd(struct _adapter *padapter, int chplan) 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 writeRF_parm *pwriterfparm; @@ -267,17 +267,17 @@ u8 r8712_setrfreg_cmd(struct _adapter *padapter, u8 offset, u32 val) ph2c = kmalloc(sizeof(*ph2c), GFP_ATOMIC); if (!ph2c) - return _FAIL; + return -ENOMEM; pwriterfparm = kmalloc(sizeof(*pwriterfparm), GFP_ATOMIC); if (!pwriterfparm) { kfree(ph2c); - return _FAIL; + return -ENOMEM; } init_h2fwcmd_w_parm_no_rsp(ph2c, pwriterfparm, GEN_CMD_CODE(_SetRFReg)); pwriterfparm->offset = offset; pwriterfparm->value = val; r8712_enqueue_cmd(pcmdpriv, ph2c); - return _SUCCESS; + return 0; } u8 r8712_getrfreg_cmd(struct _adapter *padapter, u8 offset, u8 *pval) diff --git a/drivers/staging/rtl8712/rtl871x_cmd.h b/drivers/staging/rtl8712/rtl871x_cmd.h index b582f2cbe0ef..6b004ce330d5 100644 --- a/drivers/staging/rtl8712/rtl871x_cmd.h +++ b/drivers/staging/rtl8712/rtl871x_cmd.h @@ -721,7 +721,7 @@ void r8712_setopmode_cmd(struct _adapter *padapter, int r8712_setdatarate_cmd(struct _adapter *padapter, u8 *rateset); void r8712_set_chplan_cmd(struct _adapter *padapter, int chplan); 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_wdg_wk_cmd(struct _adapter *padapter); void r8712_survey_cmd_callback(struct _adapter *padapter, diff --git a/drivers/staging/rtl8712/rtl871x_ioctl_rtl.c b/drivers/staging/rtl8712/rtl871x_ioctl_rtl.c index 2dc20da21679..861bbafac867 100644 --- a/drivers/staging/rtl8712/rtl871x_ioctl_rtl.c +++ b/drivers/staging/rtl8712/rtl871x_ioctl_rtl.c @@ -429,7 +429,7 @@ uint oid_rt_pro_rf_write_registry_hdl(struct oid_par_priv* return RNDIS_STATUS_NOT_ACCEPTED; if (poid_par_priv->information_buf_len == (sizeof(unsigned long) * 3)) { - if (!r8712_setrfreg_cmd(Adapter, + if (r8712_setrfreg_cmd(Adapter, *(unsigned char *)poid_par_priv->information_buf, (unsigned long)(*((unsigned long *) poid_par_priv->information_buf + 2)))) |