From: Jes Sorensen Date: Fri, 9 May 2014 13:04:00 +0000 (+0200) Subject: staging: rtl8723au: Eliminate RTW_STATUS_CODE23a() X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=be4c50604d22f0fd2c65853af18292f44d784b86;p=linux-beck.git staging: rtl8723au: Eliminate RTW_STATUS_CODE23a() Inline the parsing of status codes. Long term we should pass back the proper status codes and get rid of the ugly _FAIL/_SUCCESS mess. This is one small step in that direction. Signed-off-by: Jes Sorensen Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/rtl8723au/core/rtw_io.c b/drivers/staging/rtl8723au/core/rtw_io.c index 20680e0ce9e0..cf6d30f005b6 100644 --- a/drivers/staging/rtl8723au/core/rtw_io.c +++ b/drivers/staging/rtl8723au/core/rtw_io.c @@ -72,7 +72,10 @@ int _rtw_write823a(struct rtw_adapter *adapter, u32 addr, u8 val) ret = io_ops->_write8(adapter, addr, val); - return RTW_STATUS_CODE23a(ret); + if (ret < 0) + return _FAIL; + else + return _SUCCESS; } int _rtw_write1623a(struct rtw_adapter *adapter, u32 addr, u16 val) @@ -82,7 +85,10 @@ int _rtw_write1623a(struct rtw_adapter *adapter, u32 addr, u16 val) ret = io_ops->_write16(adapter, addr, val); - return RTW_STATUS_CODE23a(ret); + if (ret < 0) + return _FAIL; + else + return _SUCCESS; } int _rtw_write3223a(struct rtw_adapter *adapter, u32 addr, u32 val) @@ -92,7 +98,10 @@ int _rtw_write3223a(struct rtw_adapter *adapter, u32 addr, u32 val) ret = io_ops->_write32(adapter, addr, val); - return RTW_STATUS_CODE23a(ret); + if (ret < 0) + return _FAIL; + else + return _SUCCESS; } int _rtw_writeN23a(struct rtw_adapter *adapter, u32 addr , u32 length , u8 *pdata) @@ -102,7 +111,10 @@ int _rtw_writeN23a(struct rtw_adapter *adapter, u32 addr , u32 length , u8 *pdat ret = io_ops->_writeN(adapter, addr, length, pdata); - return RTW_STATUS_CODE23a(ret); + if (ret < 0) + return _FAIL; + else + return _SUCCESS; } void _rtw_read_mem23a(struct rtw_adapter *adapter, u32 addr, u32 cnt, u8 *pmem) { diff --git a/drivers/staging/rtl8723au/include/osdep_service.h b/drivers/staging/rtl8723au/include/osdep_service.h index 6992797044a8..c4711a6c0af0 100644 --- a/drivers/staging/rtl8723au/include/osdep_service.h +++ b/drivers/staging/rtl8723au/include/osdep_service.h @@ -126,8 +126,6 @@ static inline u32 CHKBIT(u32 x) #define BIT35 0x0800000000 #define BIT36 0x1000000000 -int RTW_STATUS_CODE23a(int error_code); - extern unsigned char REALTEK_96B_IE23A[]; extern unsigned char MCS_rate_2R23A[16]; extern unsigned char WPA_TKIP_CIPHER23A[4]; diff --git a/drivers/staging/rtl8723au/os_dep/osdep_service.c b/drivers/staging/rtl8723au/os_dep/osdep_service.c index 57c7bf8c314b..f5f385b7932f 100644 --- a/drivers/staging/rtl8723au/os_dep/osdep_service.c +++ b/drivers/staging/rtl8723au/os_dep/osdep_service.c @@ -20,17 +20,6 @@ #include #include -/* -* Translate the OS dependent @param error_code to OS independent RTW_STATUS_CODE23a -* @return: one of RTW_STATUS_CODE23a -*/ -inline int RTW_STATUS_CODE23a(int error_code) -{ - if (error_code >= 0) - return _SUCCESS; - return _FAIL; -} - void _rtw_init_queue23a(struct rtw_queue *pqueue) { INIT_LIST_HEAD(&pqueue->queue);