From 520106f61e164f07f88844ab20a5c709b9716dd4 Mon Sep 17 00:00:00 2001 From: Jes Sorensen Date: Sat, 26 Apr 2014 18:55:29 +0200 Subject: [PATCH] staging: rtl8723au: Get rid of struct io_priv No point wrapping struct intf_hdl into struct io_priv just for the sake of it. Signed-off-by: Jes Sorensen Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723au/core/rtw_io.c | 40 +++++++------------ drivers/staging/rtl8723au/hal/usb_halinit.c | 2 +- drivers/staging/rtl8723au/hal/usb_ops_linux.c | 3 +- drivers/staging/rtl8723au/include/drv_types.h | 2 +- drivers/staging/rtl8723au/include/rtw_io.h | 10 ----- drivers/staging/rtl8723au/os_dep/usb_intf.c | 1 - 6 files changed, 17 insertions(+), 41 deletions(-) diff --git a/drivers/staging/rtl8723au/core/rtw_io.c b/drivers/staging/rtl8723au/core/rtw_io.c index e862f584900a..442a86b69e04 100644 --- a/drivers/staging/rtl8723au/core/rtw_io.c +++ b/drivers/staging/rtl8723au/core/rtw_io.c @@ -44,8 +44,7 @@ jackson@realtek.com.tw u8 _rtw_read823a(struct rtw_adapter *adapter, u32 addr) { u8 r_val; - struct io_priv *pio_priv = &adapter->iopriv; - struct intf_hdl *pintfhdl = &pio_priv->intf; + struct intf_hdl *pintfhdl = &adapter->intf; r_val = pintfhdl->io_ops._read8(pintfhdl, addr); @@ -55,8 +54,7 @@ u8 _rtw_read823a(struct rtw_adapter *adapter, u32 addr) u16 _rtw_read1623a(struct rtw_adapter *adapter, u32 addr) { u16 r_val; - struct io_priv *pio_priv = &adapter->iopriv; - struct intf_hdl *pintfhdl = &pio_priv->intf; + struct intf_hdl *pintfhdl = &adapter->intf; r_val = pintfhdl->io_ops._read16(pintfhdl, addr); @@ -66,8 +64,7 @@ u16 _rtw_read1623a(struct rtw_adapter *adapter, u32 addr) u32 _rtw_read3223a(struct rtw_adapter *adapter, u32 addr) { u32 r_val; - struct io_priv *pio_priv = &adapter->iopriv; - struct intf_hdl *pintfhdl = &pio_priv->intf; + struct intf_hdl *pintfhdl = &adapter->intf; r_val = pintfhdl->io_ops._read32(pintfhdl, addr); @@ -76,8 +73,7 @@ u32 _rtw_read3223a(struct rtw_adapter *adapter, u32 addr) int _rtw_write823a(struct rtw_adapter *adapter, u32 addr, u8 val) { - struct io_priv *pio_priv = &adapter->iopriv; - struct intf_hdl *pintfhdl = &pio_priv->intf; + struct intf_hdl *pintfhdl = &adapter->intf; int ret; ret = pintfhdl->io_ops._write8(pintfhdl, addr, val); @@ -87,8 +83,7 @@ int _rtw_write823a(struct rtw_adapter *adapter, u32 addr, u8 val) int _rtw_write1623a(struct rtw_adapter *adapter, u32 addr, u16 val) { - struct io_priv *pio_priv = &adapter->iopriv; - struct intf_hdl *pintfhdl = &pio_priv->intf; + struct intf_hdl *pintfhdl = &adapter->intf; int ret; val = cpu_to_le16(val); @@ -96,10 +91,10 @@ int _rtw_write1623a(struct rtw_adapter *adapter, u32 addr, u16 val) return RTW_STATUS_CODE23a(ret); } + int _rtw_write3223a(struct rtw_adapter *adapter, u32 addr, u32 val) { - struct io_priv *pio_priv = &adapter->iopriv; - struct intf_hdl *pintfhdl = &pio_priv->intf; + struct intf_hdl *pintfhdl = &adapter->intf; int ret; val = cpu_to_le32(val); @@ -110,8 +105,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) { - struct io_priv *pio_priv = &adapter->iopriv; - struct intf_hdl *pintfhdl = (struct intf_hdl*)&pio_priv->intf; + struct intf_hdl *pintfhdl = &adapter->intf; int ret; ret = pintfhdl->io_ops._writeN(pintfhdl, addr, length, pdata); @@ -120,8 +114,7 @@ int _rtw_writeN23a(struct rtw_adapter *adapter, u32 addr , u32 length , u8 *pdat } void _rtw_read_mem23a(struct rtw_adapter *adapter, u32 addr, u32 cnt, u8 *pmem) { - struct io_priv *pio_priv = &adapter->iopriv; - struct intf_hdl *pintfhdl = &pio_priv->intf; + struct intf_hdl *pintfhdl = &adapter->intf; if ((adapter->bDriverStopped == true) || (adapter->bSurpriseRemoved == true)) { @@ -137,8 +130,7 @@ void _rtw_read_mem23a(struct rtw_adapter *adapter, u32 addr, u32 cnt, u8 *pmem) void _rtw_write_mem23a(struct rtw_adapter *adapter, u32 addr, u32 cnt, u8 *pmem) { - struct io_priv *pio_priv = &adapter->iopriv; - struct intf_hdl *pintfhdl = &pio_priv->intf; + struct intf_hdl *pintfhdl = &adapter->intf; pintfhdl->io_ops._write_mem(pintfhdl, addr, cnt, pmem); } @@ -146,8 +138,7 @@ void _rtw_write_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) { - struct io_priv *pio_priv = &adapter->iopriv; - struct intf_hdl *pintfhdl = &pio_priv->intf; + struct intf_hdl *pintfhdl = &adapter->intf; if ((adapter->bDriverStopped == true) || (adapter->bSurpriseRemoved == true)) { @@ -164,8 +155,7 @@ void _rtw_read_port23a(struct rtw_adapter *adapter, u32 addr, u32 cnt, void _rtw_read_port23a_cancel(struct rtw_adapter *adapter) { void (*_read_port_cancel)(struct intf_hdl *pintfhdl); - struct io_priv *pio_priv = &adapter->iopriv; - struct intf_hdl *pintfhdl = &pio_priv->intf; + struct intf_hdl *pintfhdl = &adapter->intf; _read_port_cancel = pintfhdl->io_ops._read_port_cancel; @@ -176,8 +166,7 @@ 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 io_priv *pio_priv = &adapter->iopriv; - struct intf_hdl *pintfhdl = &pio_priv->intf; + struct intf_hdl *pintfhdl = &adapter->intf; u32 ret = _SUCCESS; ret = pintfhdl->io_ops._write_port(pintfhdl, addr, cnt, xbuf); @@ -188,8 +177,7 @@ 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 intf_hdl *pintfhdl); - struct io_priv *pio_priv = &adapter->iopriv; - struct intf_hdl *pintfhdl = &pio_priv->intf; + struct intf_hdl *pintfhdl = &adapter->intf; _write_port_cancel = pintfhdl->io_ops._write_port_cancel; diff --git a/drivers/staging/rtl8723au/hal/usb_halinit.c b/drivers/staging/rtl8723au/hal/usb_halinit.c index 0a6e343373ff..f5b1b10bed58 100644 --- a/drivers/staging/rtl8723au/hal/usb_halinit.c +++ b/drivers/staging/rtl8723au/hal/usb_halinit.c @@ -1227,7 +1227,7 @@ static unsigned int rtl8723au_inirp_init(struct rtw_adapter *Adapter) u8 i; struct recv_buf *precvbuf; uint status; - struct intf_hdl *pintfhdl = &Adapter->iopriv.intf; + struct intf_hdl *pintfhdl = &Adapter->intf; struct recv_priv *precvpriv = &Adapter->recvpriv; u32 (*_read_port)(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, struct recv_buf *rbuf); diff --git a/drivers/staging/rtl8723au/hal/usb_ops_linux.c b/drivers/staging/rtl8723au/hal/usb_ops_linux.c index 1a67255887af..c861a791f43d 100644 --- a/drivers/staging/rtl8723au/hal/usb_ops_linux.c +++ b/drivers/staging/rtl8723au/hal/usb_ops_linux.c @@ -817,8 +817,7 @@ void rtl8723au_xmit_tasklet(void *priv) void rtl8723au_set_intf_ops(struct rtw_adapter *padapter) { - struct io_priv *piopriv = &padapter->iopriv; - struct intf_hdl *pintf = &piopriv->intf; + struct intf_hdl *pintf = &padapter->intf; struct _io_ops *pops = &pintf->io_ops; pintf->padapter = padapter; diff --git a/drivers/staging/rtl8723au/include/drv_types.h b/drivers/staging/rtl8723au/include/drv_types.h index b82d5a1fe602..1e06a37e8af5 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 io_priv iopriv; + struct intf_hdl intf; 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 f0f97b447d9e..86ecbea77ed3 100644 --- a/drivers/staging/rtl8723au/include/rtw_io.h +++ b/drivers/staging/rtl8723au/include/rtw_io.h @@ -256,16 +256,6 @@ struct reg_protocol_wt { }; - -/* -Below is the data structure used by _io_handler - -*/ - -struct io_priv{ - struct intf_hdl intf; -}; - uint register_intf_hdl(u8 *dev, struct intf_hdl *pintfhdl); void unregister_intf_hdl(struct intf_hdl *pintfhdl); diff --git a/drivers/staging/rtl8723au/os_dep/usb_intf.c b/drivers/staging/rtl8723au/os_dep/usb_intf.c index 87ba2073ede4..797393a70810 100644 --- a/drivers/staging/rtl8723au/os_dep/usb_intf.c +++ b/drivers/staging/rtl8723au/os_dep/usb_intf.c @@ -622,7 +622,6 @@ static struct rtw_adapter *rtw_usb_if1_init(struct dvobj_priv *dvobj, padapter->intf_start = &usb_intf_start; padapter->intf_stop = &usb_intf_stop; - /* step init_io_priv */ rtl8723au_set_intf_ops(padapter); /* step read_chip_version */ -- 2.34.1