From: Jes Sorensen Date: Sat, 26 Apr 2014 16:55:34 +0000 (+0200) Subject: staging: rtl8723au: Eliminate struct intf_hdl X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=28c71e23d2b43a2e687edd9342dca24a21b777e6;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git staging: rtl8723au: Eliminate struct intf_hdl 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 0f424f946dbb..01022113950a 100644 --- a/drivers/staging/rtl8723au/core/rtw_io.c +++ b/drivers/staging/rtl8723au/core/rtw_io.c @@ -44,9 +44,9 @@ jackson@realtek.com.tw u8 _rtw_read823a(struct rtw_adapter *adapter, u32 addr) { u8 r_val; - struct intf_hdl *pintfhdl = &adapter->intf; + struct _io_ops *io_ops = &adapter->io_ops; - r_val = pintfhdl->io_ops._read8(adapter, addr); + r_val = io_ops->_read8(adapter, addr); return r_val; } @@ -54,9 +54,9 @@ u8 _rtw_read823a(struct rtw_adapter *adapter, u32 addr) u16 _rtw_read1623a(struct rtw_adapter *adapter, u32 addr) { u16 r_val; - struct intf_hdl *pintfhdl = &adapter->intf; + struct _io_ops *io_ops = &adapter->io_ops; - r_val = pintfhdl->io_ops._read16(adapter, addr); + r_val = io_ops->_read16(adapter, addr); return le16_to_cpu(r_val); } @@ -64,57 +64,57 @@ u16 _rtw_read1623a(struct rtw_adapter *adapter, u32 addr) u32 _rtw_read3223a(struct rtw_adapter *adapter, u32 addr) { u32 r_val; - struct intf_hdl *pintfhdl = &adapter->intf; + struct _io_ops *io_ops = &adapter->io_ops; - r_val = pintfhdl->io_ops._read32(adapter, addr); + r_val = io_ops->_read32(adapter, addr); return le32_to_cpu(r_val); } int _rtw_write823a(struct rtw_adapter *adapter, u32 addr, u8 val) { - struct intf_hdl *pintfhdl = &adapter->intf; + struct _io_ops *io_ops = &adapter->io_ops; int ret; - ret = pintfhdl->io_ops._write8(adapter, addr, val); + ret = io_ops->_write8(adapter, addr, val); return RTW_STATUS_CODE23a(ret); } int _rtw_write1623a(struct rtw_adapter *adapter, u32 addr, u16 val) { - struct intf_hdl *pintfhdl = &adapter->intf; + struct _io_ops *io_ops = &adapter->io_ops; int ret; val = cpu_to_le16(val); - ret = pintfhdl->io_ops._write16(adapter, addr, val); + ret = io_ops->_write16(adapter, addr, val); return RTW_STATUS_CODE23a(ret); } int _rtw_write3223a(struct rtw_adapter *adapter, u32 addr, u32 val) { - struct intf_hdl *pintfhdl = &adapter->intf; + struct _io_ops *io_ops = &adapter->io_ops; int ret; val = cpu_to_le32(val); - ret = pintfhdl->io_ops._write32(adapter, addr, val); + ret = io_ops->_write32(adapter, addr, val); return RTW_STATUS_CODE23a(ret); } int _rtw_writeN23a(struct rtw_adapter *adapter, u32 addr , u32 length , u8 *pdata) { - struct intf_hdl *pintfhdl = &adapter->intf; + struct _io_ops *io_ops = &adapter->io_ops; int ret; - ret = pintfhdl->io_ops._writeN(adapter, addr, length, pdata); + ret = io_ops->_writeN(adapter, addr, length, pdata); return RTW_STATUS_CODE23a(ret); } void _rtw_read_mem23a(struct rtw_adapter *adapter, u32 addr, u32 cnt, u8 *pmem) { - struct intf_hdl *pintfhdl = &adapter->intf; + struct _io_ops *io_ops = &adapter->io_ops; if ((adapter->bDriverStopped == true) || (adapter->bSurpriseRemoved == true)) { @@ -125,20 +125,20 @@ void _rtw_read_mem23a(struct rtw_adapter *adapter, u32 addr, u32 cnt, u8 *pmem) return; } - pintfhdl->io_ops._read_mem(adapter, addr, cnt, pmem); + io_ops->_read_mem(adapter, addr, cnt, pmem); } void _rtw_write_mem23a(struct rtw_adapter *adapter, u32 addr, u32 cnt, u8 *pmem) { - struct intf_hdl *pintfhdl = &adapter->intf; + struct _io_ops *io_ops = &adapter->io_ops; - pintfhdl->io_ops._write_mem(adapter, addr, cnt, pmem); + io_ops->_write_mem(adapter, addr, cnt, pmem); } void _rtw_read_port23a(struct rtw_adapter *adapter, u32 addr, u32 cnt, - struct recv_buf *rbuf) + struct recv_buf *rbuf) { - struct intf_hdl *pintfhdl = &adapter->intf; + struct _io_ops *io_ops = &adapter->io_ops; if ((adapter->bDriverStopped == true) || (adapter->bSurpriseRemoved == true)) { @@ -149,15 +149,15 @@ void _rtw_read_port23a(struct rtw_adapter *adapter, u32 addr, u32 cnt, return; } - pintfhdl->io_ops._read_port(adapter, addr, cnt, rbuf); + io_ops->_read_port(adapter, addr, cnt, rbuf); } void _rtw_read_port23a_cancel(struct rtw_adapter *adapter) { void (*_read_port_cancel)(struct rtw_adapter *adapter); - struct intf_hdl *pintfhdl = &adapter->intf; + struct _io_ops *io_ops = &adapter->io_ops; - _read_port_cancel = pintfhdl->io_ops._read_port_cancel; + _read_port_cancel = io_ops->_read_port_cancel; if (_read_port_cancel) _read_port_cancel(adapter); @@ -166,10 +166,10 @@ void _rtw_read_port23a_cancel(struct rtw_adapter *adapter) u32 _rtw_write_port23a(struct rtw_adapter *adapter, u32 addr, u32 cnt, struct xmit_buf *xbuf) { - struct intf_hdl *pintfhdl = &adapter->intf; + struct _io_ops *io_ops = &adapter->io_ops; u32 ret = _SUCCESS; - ret = pintfhdl->io_ops._write_port(adapter, addr, cnt, xbuf); + ret = io_ops->_write_port(adapter, addr, cnt, xbuf); return ret; } @@ -177,9 +177,9 @@ u32 _rtw_write_port23a(struct rtw_adapter *adapter, u32 addr, u32 cnt, void _rtw_write_port23a_cancel(struct rtw_adapter *adapter) { void (*_write_port_cancel)(struct rtw_adapter *adapter); - struct intf_hdl *pintfhdl = &adapter->intf; + struct _io_ops *io_ops = &adapter->io_ops; - _write_port_cancel = pintfhdl->io_ops._write_port_cancel; + _write_port_cancel = io_ops->_write_port_cancel; if (_write_port_cancel) _write_port_cancel(adapter); diff --git a/drivers/staging/rtl8723au/hal/usb_halinit.c b/drivers/staging/rtl8723au/hal/usb_halinit.c index 1dd2a08a0963..f300349e88cf 100644 --- a/drivers/staging/rtl8723au/hal/usb_halinit.c +++ b/drivers/staging/rtl8723au/hal/usb_halinit.c @@ -1227,14 +1227,14 @@ static unsigned int rtl8723au_inirp_init(struct rtw_adapter *Adapter) u8 i; struct recv_buf *precvbuf; uint status; - struct intf_hdl *pintfhdl = &Adapter->intf; + 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, struct recv_buf *rbuf); u32 (*_read_interrupt)(struct rtw_adapter *padapter, u32 addr); struct hal_data_8723a *pHalData = GET_HAL_DATA(Adapter); - _read_port = pintfhdl->io_ops._read_port; + _read_port = io_ops->_read_port; status = _SUCCESS; @@ -1255,7 +1255,7 @@ static unsigned int rtl8723au_inirp_init(struct rtw_adapter *Adapter) precvbuf++; precvpriv->free_recv_buf_queue_cnt--; } - _read_interrupt = pintfhdl->io_ops._read_interrupt; + _read_interrupt = io_ops->_read_interrupt; if (_read_interrupt(Adapter, RECV_INT_IN_ADDR) == false) { RT_TRACE(_module_hci_hal_init_c_, _drv_err_, ("usb_rx_init: usb_read_interrupt error\n")); diff --git a/drivers/staging/rtl8723au/hal/usb_ops_linux.c b/drivers/staging/rtl8723au/hal/usb_ops_linux.c index b5332888226c..12997a5cd7a8 100644 --- a/drivers/staging/rtl8723au/hal/usb_ops_linux.c +++ b/drivers/staging/rtl8723au/hal/usb_ops_linux.c @@ -824,8 +824,7 @@ void rtl8723au_xmit_tasklet(void *priv) void rtl8723au_set_intf_ops(struct rtw_adapter *padapter) { - struct intf_hdl *pintf = &padapter->intf; - struct _io_ops *pops = &pintf->io_ops; + struct _io_ops *pops = &padapter->io_ops; memset((u8 *)pops, 0, sizeof(struct _io_ops)); diff --git a/drivers/staging/rtl8723au/include/drv_types.h b/drivers/staging/rtl8723au/include/drv_types.h index 1e06a37e8af5..c2c192410aa5 100644 --- a/drivers/staging/rtl8723au/include/drv_types.h +++ b/drivers/staging/rtl8723au/include/drv_types.h @@ -242,7 +242,7 @@ struct rtw_adapter { struct mlme_ext_priv mlmeextpriv; struct cmd_priv cmdpriv; struct evt_priv evtpriv; - struct intf_hdl intf; + struct _io_ops io_ops; struct xmit_priv xmitpriv; struct recv_priv recvpriv; struct sta_priv stapriv; diff --git a/drivers/staging/rtl8723au/include/rtw_io.h b/drivers/staging/rtl8723au/include/rtw_io.h index 745d0ef25af3..fffe028750c2 100644 --- a/drivers/staging/rtl8723au/include/rtw_io.h +++ b/drivers/staging/rtl8723au/include/rtw_io.h @@ -97,7 +97,6 @@ #define _INTF_ASYNC_ BIT(0) /* support async io */ struct intf_priv; -struct intf_hdl; struct _io_ops { @@ -135,10 +134,6 @@ struct io_req { u8 *cnxt; }; -struct intf_hdl { - struct _io_ops io_ops; -}; - struct reg_protocol_rd { #ifdef __LITTLE_ENDIAN