diff options
author | Luca Ceresoli <luca@lucaceresoli.net> | 2015-05-19 11:35:26 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-05-31 12:01:37 +0900 |
commit | 7fc0406f4875a414e4243706f98967064a4fa962 (patch) | |
tree | 1a7e99d23fdeba75abaacb387907eb2cb29c5299 /drivers | |
parent | 8b9ffb43ac1deabc80c2622a293a12d5f1a8d0ac (diff) | |
download | op-kernel-dev-7fc0406f4875a414e4243706f98967064a4fa962.zip op-kernel-dev-7fc0406f4875a414e4243706f98967064a4fa962.tar.gz |
staging: rtl8188eu: return an error code, not a boolean
"If the name of a function is an action or an imperative command,
the function should return an error-code integer." (Documentation/CodingStyle)
Several action-like functions in this driver return a boolean: _SUCCESS = 1 on
success, _FAIL = 0 on error, defined in
drivers/staging/rtl8188eu/include/osdep_service.h.
Change rtw_start_drv_threads() to return a proper 0-or-error value.
Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Cc: Greg Kroah-Hartman <gregkh@linux.com>
Cc: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/staging/rtl8188eu/os_dep/os_intfs.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/staging/rtl8188eu/os_dep/os_intfs.c b/drivers/staging/rtl8188eu/os_dep/os_intfs.c index d411e18..2e96234 100644 --- a/drivers/staging/rtl8188eu/os_dep/os_intfs.c +++ b/drivers/staging/rtl8188eu/os_dep/os_intfs.c @@ -752,21 +752,21 @@ struct net_device *rtw_init_netdev(struct adapter *old_padapter) return pnetdev; } -static u32 rtw_start_drv_threads(struct adapter *padapter) +static int rtw_start_drv_threads(struct adapter *padapter) { - u32 _status = _SUCCESS; + int err = 0; RT_TRACE(_module_os_intfs_c_, _drv_info_, ("+rtw_start_drv_threads\n")); padapter->cmdThread = kthread_run(rtw_cmd_thread, padapter, "RTW_CMD_THREAD"); if (IS_ERR(padapter->cmdThread)) - _status = _FAIL; + err = PTR_ERR(padapter->cmdThread); else /* wait for cmd_thread to run */ _rtw_down_sema(&padapter->cmdpriv.terminate_cmdthread_sema); - return _status; + return err; } void rtw_stop_drv_threads(struct adapter *padapter) @@ -979,6 +979,7 @@ u8 rtw_free_drv_sw(struct adapter *padapter) static int _netdev_open(struct net_device *pnetdev) { uint status; + int err; struct adapter *padapter = (struct adapter *)rtw_netdev_priv(pnetdev); struct pwrctrl_priv *pwrctrlpriv = &padapter->pwrctrlpriv; @@ -1002,8 +1003,8 @@ static int _netdev_open(struct net_device *pnetdev) pr_info("MAC Address = %pM\n", pnetdev->dev_addr); - status = rtw_start_drv_threads(padapter); - if (status == _FAIL) { + err = rtw_start_drv_threads(padapter); + if (err) { pr_info("Initialize driver software resource Failed!\n"); goto netdev_open_error; } |