From: navin patidar Date: Wed, 11 Jun 2014 17:21:26 +0000 (+0530) Subject: staging: rtl8188eu: Remove function _rtw_writeN() X-Git-Tag: firefly_0821_release~176^2~3491^2~1814 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=b9c74f3196bc417efc3c6a29498b77afed8fdc11;p=firefly-linux-kernel-4.4.55.git staging: rtl8188eu: Remove function _rtw_writeN() _rtw_writeN() is a wrapper function, being used to call usb_writeN(). Call usb_writeN() directly and drop _rtw_writeN(). Signed-off-by: navin patidar Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/rtl8188eu/core/rtw_io.c b/drivers/staging/rtl8188eu/core/rtw_io.c index 85306bff6662..ee1fadeab99f 100644 --- a/drivers/staging/rtl8188eu/core/rtw_io.c +++ b/drivers/staging/rtl8188eu/core/rtw_io.c @@ -126,19 +126,6 @@ int _rtw_write32(struct adapter *adapter, u32 addr, u32 val) return RTW_STATUS_CODE(ret); } -int _rtw_writeN(struct adapter *adapter, u32 addr , u32 length , u8 *pdata) -{ - struct io_priv *pio_priv = &adapter->iopriv; - struct intf_hdl *pintfhdl = (struct intf_hdl *)(&(pio_priv->intf)); - int (*_writeN)(struct adapter *pintfhdl, u32 addr, u32 length, u8 *pdata); - int ret; - _writeN = pintfhdl->io_ops._writeN; - - ret = _writeN(adapter, addr, length, pdata); - - return RTW_STATUS_CODE(ret); -} - void _rtw_read_port(struct adapter *adapter, u32 addr, u32 cnt, u8 *pmem) { u32 (*_read_port)(struct adapter *pintfhdl, u32 addr, u32 cnt, u8 *pmem); diff --git a/drivers/staging/rtl8188eu/hal/rtl8188e_hal_init.c b/drivers/staging/rtl8188eu/hal/rtl8188e_hal_init.c index 208b3739b644..1a53a1678102 100644 --- a/drivers/staging/rtl8188eu/hal/rtl8188e_hal_init.c +++ b/drivers/staging/rtl8188eu/hal/rtl8188e_hal_init.c @@ -441,7 +441,7 @@ static int _BlockWrite(struct adapter *padapter, void *buffer, u32 buffSize) } for (i = 0; i < blockCount_p1; i++) { - ret = rtw_writeN(padapter, (FW_8188E_START_ADDRESS + i * blockSize_p1), blockSize_p1, (bufferPtr + i * blockSize_p1)); + ret = usb_writeN(padapter, (FW_8188E_START_ADDRESS + i * blockSize_p1), blockSize_p1, (bufferPtr + i * blockSize_p1)); if (ret == _FAIL) goto exit; } @@ -460,7 +460,7 @@ static int _BlockWrite(struct adapter *padapter, void *buffer, u32 buffSize) } for (i = 0; i < blockCount_p2; i++) { - ret = rtw_writeN(padapter, (FW_8188E_START_ADDRESS + offset + i*blockSize_p2), blockSize_p2, (bufferPtr + offset + i*blockSize_p2)); + ret = usb_writeN(padapter, (FW_8188E_START_ADDRESS + offset + i*blockSize_p2), blockSize_p2, (bufferPtr + offset + i*blockSize_p2)); if (ret == _FAIL) goto exit; diff --git a/drivers/staging/rtl8188eu/hal/usb_ops_linux.c b/drivers/staging/rtl8188eu/hal/usb_ops_linux.c index d1f00db072c6..24b347b08d1b 100644 --- a/drivers/staging/rtl8188eu/hal/usb_ops_linux.c +++ b/drivers/staging/rtl8188eu/hal/usb_ops_linux.c @@ -252,7 +252,7 @@ static int usb_write32(struct adapter *adapter, u32 addr, u32 val) return ret; } -static int usb_writeN(struct adapter *adapter, u32 addr, u32 length, u8 *pdata) +int usb_writeN(struct adapter *adapter, u32 addr, u32 length, u8 *pdata) { u8 request; u8 requesttype; @@ -274,7 +274,7 @@ static int usb_writeN(struct adapter *adapter, u32 addr, u32 length, u8 *pdata) ret = usbctrl_vendorreq(adapter, request, wvalue, index, buf, len, requesttype); - return ret; + return RTW_STATUS_CODE(ret); } static void interrupt_handler_8188eu(struct adapter *adapt, u16 pkt_len, u8 *pbuf) @@ -673,7 +673,6 @@ void rtl8188eu_set_intf_ops(struct _io_ops *pops) pops->_write8 = &usb_write8; pops->_write16 = &usb_write16; pops->_write32 = &usb_write32; - pops->_writeN = &usb_writeN; pops->_write_port = &usb_write_port; pops->_read_port_cancel = &usb_read_port_cancel; pops->_write_port_cancel = &usb_write_port_cancel; diff --git a/drivers/staging/rtl8188eu/include/rtw_io.h b/drivers/staging/rtl8188eu/include/rtw_io.h index f5a40b69bedc..77193b564380 100644 --- a/drivers/staging/rtl8188eu/include/rtw_io.h +++ b/drivers/staging/rtl8188eu/include/rtw_io.h @@ -50,8 +50,6 @@ struct _io_ops { int (*_write8)(struct adapter *pintfhdl, u32 addr, u8 val); int (*_write16)(struct adapter *pintfhdl, u32 addr, u16 val); int (*_write32)(struct adapter *pintfhdl, u32 addr, u32 val); - int (*_writeN)(struct adapter *pintfhdl, u32 addr, u32 length, - u8 *pdata); u32 (*_read_port)(struct adapter *pintfhdl, u32 addr, u32 cnt, u8 *pmem); u32 (*_write_port)(struct adapter *pintfhdl, u32 addr, u32 cnt, @@ -98,7 +96,7 @@ void _rtw_read_port_cancel(struct adapter *adapter); int _rtw_write8(struct adapter *adapter, u32 addr, u8 val); int _rtw_write16(struct adapter *adapter, u32 addr, u16 val); int _rtw_write32(struct adapter *adapter, u32 addr, u32 val); -int _rtw_writeN(struct adapter *adapter, u32 addr, u32 length, u8 *pdata); +int usb_writeN(struct adapter *adapter, u32 addr, u32 length, u8 *pdata); u32 _rtw_write_port(struct adapter *adapter, u32 addr, u32 cnt, u8 *pmem); void _rtw_write_port_cancel(struct adapter *adapter); @@ -116,8 +114,6 @@ void _rtw_write_port_cancel(struct adapter *adapter); _rtw_write16((adapter), (addr), (val)) #define rtw_write32(adapter, addr, val) \ _rtw_write32((adapter), (addr), (val)) -#define rtw_writeN(adapter, addr, length, data) \ - _rtw_writeN((adapter), (addr), (length), (data)) #define rtw_write_port(adapter, addr, cnt, mem) \ _rtw_write_port((adapter), (addr), (cnt), (mem)) #define rtw_write_port_cancel(adapter) _rtw_write_port_cancel((adapter))