diff options
author | Jes Sorensen <Jes.Sorensen@redhat.com> | 2014-05-16 10:04:31 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-05-16 11:34:28 -0700 |
commit | ad899b12192ef2fa0cf81a88a320d5a0de4d5151 (patch) | |
tree | b74faa3c32b2913268f05d37dbef1adf11172f8e /drivers/staging | |
parent | 828373f9968c650362ab1b48b5e7b5ddbb216b64 (diff) | |
download | linux-ad899b12192ef2fa0cf81a88a320d5a0de4d5151.tar.bz2 |
staging: rtl8723au: Clean up error codes in IO functions
This also fixes up another messy case assuming _FAIL == false and
true == _SUCCESS
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging')
-rw-r--r-- | drivers/staging/rtl8723au/core/rtw_io.c | 10 | ||||
-rw-r--r-- | drivers/staging/rtl8723au/hal/usb_halinit.c | 10 | ||||
-rw-r--r-- | drivers/staging/rtl8723au/hal/usb_ops_linux.c | 8 | ||||
-rw-r--r-- | drivers/staging/rtl8723au/include/rtw_io.h | 21 | ||||
-rw-r--r-- | drivers/staging/rtl8723au/include/usb_ops_linux.h | 2 | ||||
-rw-r--r-- | drivers/staging/rtl8723au/os_dep/usb_ops_linux.c | 4 |
6 files changed, 30 insertions, 25 deletions
diff --git a/drivers/staging/rtl8723au/core/rtw_io.c b/drivers/staging/rtl8723au/core/rtw_io.c index cf6d30f005b6..0dc0cf753462 100644 --- a/drivers/staging/rtl8723au/core/rtw_io.c +++ b/drivers/staging/rtl8723au/core/rtw_io.c @@ -139,7 +139,7 @@ void _rtw_write_mem23a(struct rtw_adapter *adapter, u32 addr, u32 cnt, u8 *pmem) io_ops->_write_mem(adapter, addr, cnt, pmem); } -void _rtw_read_port23a(struct rtw_adapter *adapter, u32 addr, u32 cnt, +int _rtw_read_port23a(struct rtw_adapter *adapter, u32 addr, u32 cnt, struct recv_buf *rbuf) { struct _io_ops *io_ops = &adapter->io_ops; @@ -150,10 +150,10 @@ void _rtw_read_port23a(struct rtw_adapter *adapter, u32 addr, u32 cnt, ("rtw_read_port:bDriverStopped(%d) OR " "bSurpriseRemoved(%d)", adapter->bDriverStopped, adapter->bSurpriseRemoved)); - return; + return _FAIL; } - io_ops->_read_port(adapter, addr, cnt, rbuf); + return io_ops->_read_port(adapter, addr, cnt, rbuf); } void _rtw_read_port23a_cancel(struct rtw_adapter *adapter) @@ -167,11 +167,11 @@ void _rtw_read_port23a_cancel(struct rtw_adapter *adapter) _read_port_cancel(adapter); } -u32 _rtw_write_port23a(struct rtw_adapter *adapter, u32 addr, u32 cnt, +int _rtw_write_port23a(struct rtw_adapter *adapter, u32 addr, u32 cnt, struct xmit_buf *xbuf) { struct _io_ops *io_ops = &adapter->io_ops; - u32 ret = _SUCCESS; + int ret = _SUCCESS; ret = io_ops->_write_port(adapter, addr, cnt, xbuf); diff --git a/drivers/staging/rtl8723au/hal/usb_halinit.c b/drivers/staging/rtl8723au/hal/usb_halinit.c index e345634ecb25..df2650712191 100644 --- a/drivers/staging/rtl8723au/hal/usb_halinit.c +++ b/drivers/staging/rtl8723au/hal/usb_halinit.c @@ -1228,10 +1228,10 @@ int rtl8723au_inirp_init(struct rtw_adapter *Adapter) int status; struct _io_ops *io_ops = &Adapter->io_ops; struct recv_priv *precvpriv = &Adapter->recvpriv; - u32 (*_read_port)(struct rtw_adapter *padapter, u32 addr, u32 cnt, + int (*_read_port)(struct rtw_adapter *padapter, u32 addr, u32 cnt, struct recv_buf *rbuf); - u32 (*_read_interrupt)(struct rtw_adapter *padapter, u32 addr); - struct hal_data_8723a *pHalData = GET_HAL_DATA(Adapter); + int (*_read_interrupt)(struct rtw_adapter *padapter, u32 addr); + struct hal_data_8723a *pHalData = GET_HAL_DATA(Adapter); _read_port = io_ops->_read_port; @@ -1245,7 +1245,7 @@ int rtl8723au_inirp_init(struct rtw_adapter *Adapter) precvbuf = (struct recv_buf *)precvpriv->precv_buf; for (i = 0; i < NR_RECVBUFF; i++) { if (_read_port(Adapter, precvpriv->ff_hwaddr, 0, precvbuf) == - false) { + _FAIL) { RT_TRACE(_module_hci_hal_init_c_, _drv_err_, ("usb_rx_init: usb_read_port error\n")); status = _FAIL; @@ -1254,7 +1254,7 @@ int rtl8723au_inirp_init(struct rtw_adapter *Adapter) precvbuf++; } _read_interrupt = io_ops->_read_interrupt; - if (_read_interrupt(Adapter, RECV_INT_IN_ADDR) == false) { + if (_read_interrupt(Adapter, RECV_INT_IN_ADDR) == _FAIL) { RT_TRACE(_module_hci_hal_init_c_, _drv_err_, ("usb_rx_init: usb_read_interrupt error\n")); status = _FAIL; diff --git a/drivers/staging/rtl8723au/hal/usb_ops_linux.c b/drivers/staging/rtl8723au/hal/usb_ops_linux.c index 484006a5f338..4a83b138a8f5 100644 --- a/drivers/staging/rtl8723au/hal/usb_ops_linux.c +++ b/drivers/staging/rtl8723au/hal/usb_ops_linux.c @@ -439,11 +439,11 @@ urb_submit: } } -static u32 usb_read_interrupt(struct rtw_adapter *adapter, u32 addr) +static int usb_read_interrupt(struct rtw_adapter *adapter, u32 addr) { int err; unsigned int pipe; - u32 ret = _SUCCESS; + int ret = _SUCCESS; struct dvobj_priv *pdvobj = adapter_to_dvobj(adapter); struct recv_priv *precvpriv = &adapter->recvpriv; struct usb_device *pusbd = pdvobj->pusbdev; @@ -733,14 +733,14 @@ static void usb_read_port_complete(struct urb *purb, struct pt_regs *regs) } } -static u32 usb_read_port(struct rtw_adapter *adapter, u32 addr, u32 cnt, +static int usb_read_port(struct rtw_adapter *adapter, u32 addr, u32 cnt, struct recv_buf *precvbuf) { int err; unsigned int pipe; unsigned long tmpaddr = 0; unsigned long alignment = 0; - u32 ret = _SUCCESS; + int ret = _SUCCESS; struct urb *purb = NULL; struct dvobj_priv *pdvobj = adapter_to_dvobj(adapter); struct recv_priv *precvpriv = &adapter->recvpriv; diff --git a/drivers/staging/rtl8723au/include/rtw_io.h b/drivers/staging/rtl8723au/include/rtw_io.h index fffe028750c2..2919dcca3882 100644 --- a/drivers/staging/rtl8723au/include/rtw_io.h +++ b/drivers/staging/rtl8723au/include/rtw_io.h @@ -107,15 +107,20 @@ struct _io_ops int (*_write8)(struct rtw_adapter *adapter, u32 addr, u8 val); int (*_write16)(struct rtw_adapter *adapter, u32 addr, u16 val); int (*_write32)(struct rtw_adapter *adapter, u32 addr, u32 val); - int (*_writeN)(struct rtw_adapter *adapter, u32 addr, u32 length, u8 *pdata); + int (*_writeN)(struct rtw_adapter *adapter, u32 addr, u32 length, + u8 *pdata); - void (*_read_mem)(struct rtw_adapter *adapter, u32 addr, u32 cnt, u8 *pmem); - void (*_write_mem)(struct rtw_adapter *adapter, u32 addr, u32 cnt, u8 *pmem); + void (*_read_mem)(struct rtw_adapter *adapter, u32 addr, u32 cnt, + u8 *pmem); + void (*_write_mem)(struct rtw_adapter *adapter, u32 addr, u32 cnt, + u8 *pmem); - u32 (*_read_interrupt)(struct rtw_adapter *adapter, u32 addr); + int (*_read_interrupt)(struct rtw_adapter *adapter, u32 addr); - u32 (*_read_port)(struct rtw_adapter *adapter, u32 addr, u32 cnt, struct recv_buf *rbuf); - u32 (*_write_port)(struct rtw_adapter *adapter, u32 addr, u32 cnt, struct xmit_buf *pmem); + int (*_read_port)(struct rtw_adapter *adapter, u32 addr, u32 cnt, + struct recv_buf *rbuf); + int (*_write_port)(struct rtw_adapter *adapter, u32 addr, u32 cnt, + struct xmit_buf *pmem); void (*_read_port_cancel)(struct rtw_adapter *adapter); void (*_write_port_cancel)(struct rtw_adapter *adapter); @@ -254,7 +259,7 @@ u8 _rtw_read823a(struct rtw_adapter *adapter, u32 addr); u16 _rtw_read1623a(struct rtw_adapter *adapter, u32 addr); u32 _rtw_read3223a(struct rtw_adapter *adapter, u32 addr); void _rtw_read_mem23a(struct rtw_adapter *adapter, u32 addr, u32 cnt, u8 *pmem); -void _rtw_read_port23a(struct rtw_adapter *adapter, u32 addr, u32 cnt, struct recv_buf *rbuf); +int _rtw_read_port23a(struct rtw_adapter *adapter, u32 addr, u32 cnt, struct recv_buf *rbuf); void _rtw_read_port23a_cancel(struct rtw_adapter *adapter); int _rtw_write823a(struct rtw_adapter *adapter, u32 addr, u8 val); @@ -263,7 +268,7 @@ int _rtw_write3223a(struct rtw_adapter *adapter, u32 addr, u32 val); int _rtw_writeN23a(struct rtw_adapter *adapter, u32 addr, u32 length, u8 *pdata); void _rtw_write_mem23a(struct rtw_adapter *adapter, u32 addr, u32 cnt, u8 *pmem); -u32 _rtw_write_port23a(struct rtw_adapter *adapter, u32 addr, u32 cnt, struct xmit_buf *pmem); +int _rtw_write_port23a(struct rtw_adapter *adapter, u32 addr, u32 cnt, struct xmit_buf *pmem); void _rtw_write_port23a_cancel(struct rtw_adapter *adapter); #ifdef DBG_IO diff --git a/drivers/staging/rtl8723au/include/usb_ops_linux.h b/drivers/staging/rtl8723au/include/usb_ops_linux.h index 0eb33e01c78c..92d5eb550c63 100644 --- a/drivers/staging/rtl8723au/include/usb_ops_linux.h +++ b/drivers/staging/rtl8723au/include/usb_ops_linux.h @@ -39,7 +39,7 @@ void usb_write_mem23a(struct rtw_adapter *adapter, u32 addr, u32 cnt, u8 *wmem); void usb_read_port_cancel23a(struct rtw_adapter *adapter); -u32 usb_write_port23a(struct rtw_adapter *adapter, u32 addr, u32 cnt, +int usb_write_port23a(struct rtw_adapter *adapter, u32 addr, u32 cnt, struct xmit_buf *wmem); void usb_write_port23a_cancel(struct rtw_adapter *adapter); diff --git a/drivers/staging/rtl8723au/os_dep/usb_ops_linux.c b/drivers/staging/rtl8723au/os_dep/usb_ops_linux.c index b88f72f0f06b..b82dd89de886 100644 --- a/drivers/staging/rtl8723au/os_dep/usb_ops_linux.c +++ b/drivers/staging/rtl8723au/os_dep/usb_ops_linux.c @@ -160,7 +160,7 @@ check_completion: tasklet_hi_schedule(&pxmitpriv->xmit_tasklet); } -u32 usb_write_port23a(struct rtw_adapter *padapter, u32 addr, u32 cnt, +int usb_write_port23a(struct rtw_adapter *padapter, u32 addr, u32 cnt, struct xmit_buf *pxmitbuf) { struct urb *purb = NULL; @@ -171,7 +171,7 @@ u32 usb_write_port23a(struct rtw_adapter *padapter, u32 addr, u32 cnt, unsigned long irqL; unsigned int pipe; int status; - u32 ret = _FAIL; + int ret = _FAIL; RT_TRACE(_module_hci_ops_os_c_, _drv_err_, ("+usb_write_port23a\n")); |