From a5dedb5c98df60d931a05e711f60ad4fd94a2dc0 Mon Sep 17 00:00:00 2001 From: Nishka Dasgupta Date: Mon, 24 Jun 2019 11:19:03 +0530 Subject: [PATCH] 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 Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8712/rtl871x_cmd.c | 8 ++++---- drivers/staging/rtl8712/rtl871x_cmd.h | 2 +- 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 8af1574..cfd0971 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 b582f2c..6b004ce 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 2dc20da..861bbaf 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)))) -- 2.7.4