staging: rtl8188eu: Remove function _rtw_read_port()
authornavin patidar <navin.patidar@gmail.com>
Wed, 11 Jun 2014 17:21:27 +0000 (22:51 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 19 Jun 2014 22:34:01 +0000 (15:34 -0700)
_rtw_read_port() is a wrapper function, being used to call usb_read_port().
use usb_read_port() directly and drop _rtw_read_port().

Signed-off-by: navin patidar <navin.patidar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8188eu/core/rtw_io.c
drivers/staging/rtl8188eu/hal/usb_halinit.c
drivers/staging/rtl8188eu/hal/usb_ops_linux.c
drivers/staging/rtl8188eu/include/rtw_io.h
drivers/staging/rtl8188eu/os_dep/recv_linux.c

index ee1fadeab99fbe490e437d6717f033a8c21c506c..4a3cd3dc8d15b129e840067bfaa770b91b954f27 100644 (file)
@@ -126,26 +126,6 @@ int _rtw_write32(struct adapter *adapter, u32 addr, u32 val)
        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);
-       struct io_priv *pio_priv = &adapter->iopriv;
-       struct  intf_hdl                *pintfhdl = &(pio_priv->intf);
-
-
-       if (adapter->bDriverStopped || adapter->bSurpriseRemoved) {
-               RT_TRACE(_module_rtl871x_io_c_, _drv_info_,
-                        ("rtw_read_port:bDriverStopped(%d) OR bSurpriseRemoved(%d)",
-                        adapter->bDriverStopped, adapter->bSurpriseRemoved));
-            return;
-       }
-
-       _read_port = pintfhdl->io_ops._read_port;
-
-       _read_port(adapter, addr, cnt, pmem);
-
-}
-
 void _rtw_read_port_cancel(struct adapter *adapter)
 {
        void (*_read_port_cancel)(struct adapter *pintfhdl);
index fdbc53a80fef80542cd1cd1970b85c1408c88f3d..0118b9dc9a869f96399ed29d9d86c2e9e1ea5778 100644 (file)
@@ -1037,12 +1037,7 @@ static unsigned int rtl8188eu_inirp_init(struct adapter *Adapter)
        u8 i;
        struct recv_buf *precvbuf;
        uint    status;
-       struct intf_hdl *pintfhdl = &Adapter->iopriv.intf;
        struct recv_priv *precvpriv = &(Adapter->recvpriv);
-       u32 (*_read_port)(struct adapter *padapter, u32 addr, u32 cnt, u8 *pmem);
-
-
-       _read_port = pintfhdl->io_ops._read_port;
 
        status = _SUCCESS;
 
@@ -1054,7 +1049,7 @@ static unsigned int rtl8188eu_inirp_init(struct adapter *Adapter)
        /* issue Rx irp to receive data */
        precvbuf = (struct recv_buf *)precvpriv->precv_buf;
        for (i = 0; i < NR_RECVBUFF; i++) {
-               if (_read_port(Adapter, precvpriv->ff_hwaddr, 0, (unsigned char *)precvbuf) == false) {
+               if (usb_read_port(Adapter, precvpriv->ff_hwaddr, 0, (unsigned char *)precvbuf) == false) {
                        RT_TRACE(_module_hci_hal_init_c_, _drv_err_, ("usb_rx_init: usb_read_port error\n"));
                        status = _FAIL;
                        goto exit;
index 24b347b08d1bc70408ca223cddc5d9fbf0a2df98..c41085ca9580d0b7a760fd157dcc79624b4a18eb 100644 (file)
@@ -511,7 +511,7 @@ static void usb_read_port_complete(struct urb *purb, struct pt_regs *regs)
                        RT_TRACE(_module_hci_ops_os_c_, _drv_err_,
                                 ("usb_read_port_complete: (purb->actual_length > MAX_RECVBUF_SZ) || (purb->actual_length < RXDESC_SIZE)\n"));
                        precvbuf->reuse = true;
-                       rtw_read_port(adapt, precvpriv->ff_hwaddr, 0, (unsigned char *)precvbuf);
+                       usb_read_port(adapt, precvpriv->ff_hwaddr, 0, (unsigned char *)precvbuf);
                        DBG_88E("%s()-%d: RX Warning!\n", __func__, __LINE__);
                } else {
                        rtw_reset_continual_urb_error(adapter_to_dvobj(adapt));
@@ -524,7 +524,7 @@ static void usb_read_port_complete(struct urb *purb, struct pt_regs *regs)
 
                        precvbuf->pskb = NULL;
                        precvbuf->reuse = false;
-                       rtw_read_port(adapt, precvpriv->ff_hwaddr, 0, (unsigned char *)precvbuf);
+                       usb_read_port(adapt, precvpriv->ff_hwaddr, 0, (unsigned char *)precvbuf);
                }
        } else {
                RT_TRACE(_module_hci_ops_os_c_, _drv_err_, ("usb_read_port_complete : purb->status(%d) != 0\n", purb->status));
@@ -553,7 +553,7 @@ static void usb_read_port_complete(struct urb *purb, struct pt_regs *regs)
                                haldata->srestpriv.Wifi_Error_Status = USB_READ_PORT_FAIL;
                        }
                        precvbuf->reuse = true;
-                       rtw_read_port(adapt, precvpriv->ff_hwaddr, 0, (unsigned char *)precvbuf);
+                       usb_read_port(adapt, precvpriv->ff_hwaddr, 0, (unsigned char *)precvbuf);
                        break;
                case -EINPROGRESS:
                        DBG_88E("ERROR: URB IS IN PROGRESS!\n");
@@ -564,7 +564,7 @@ static void usb_read_port_complete(struct urb *purb, struct pt_regs *regs)
        }
 }
 
-static u32 usb_read_port(struct adapter *adapter, u32 addr, u32 cnt, u8 *rmem)
+u32 usb_read_port(struct adapter *adapter, u32 addr, u32 cnt, u8 *rmem)
 {
        struct urb *purb = NULL;
        struct recv_buf *precvbuf = (struct recv_buf *)rmem;
@@ -669,7 +669,6 @@ void rtl8188eu_set_intf_ops(struct _io_ops  *pops)
        pops->_read8 = &usb_read8;
        pops->_read16 = &usb_read16;
        pops->_read32 = &usb_read32;
-       pops->_read_port = &usb_read_port;
        pops->_write8 = &usb_write8;
        pops->_write16 = &usb_write16;
        pops->_write32 = &usb_write32;
index 77193b56438079e87d4ec8813d0c0eb0365696d6..e68b40cca5b860abf2ea0b5a9551704efcf66985 100644 (file)
@@ -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);
-       u32 (*_read_port)(struct adapter *pintfhdl, u32 addr, u32 cnt,
-                         u8 *pmem);
        u32 (*_write_port)(struct adapter *pintfhdl, u32 addr, u32 cnt,
                           u8 *pmem);
        void (*_read_port_cancel)(struct adapter *pintfhdl);
@@ -90,7 +88,7 @@ struct io_priv {
 u8 _rtw_read8(struct adapter *adapter, u32 addr);
 u16 _rtw_read16(struct adapter *adapter, u32 addr);
 u32 _rtw_read32(struct adapter *adapter, u32 addr);
-void _rtw_read_port(struct adapter *adapter, u32 addr, u32 cnt, u8 *pmem);
+u32 usb_read_port(struct adapter *adapter, u32 addr, u32 cnt, u8 *pmem);
 void _rtw_read_port_cancel(struct adapter *adapter);
 
 int _rtw_write8(struct adapter *adapter, u32 addr, u8 val);
@@ -104,8 +102,6 @@ void _rtw_write_port_cancel(struct adapter *adapter);
 #define rtw_read8(adapter, addr) _rtw_read8((adapter), (addr))
 #define rtw_read16(adapter, addr) _rtw_read16((adapter), (addr))
 #define rtw_read32(adapter, addr) _rtw_read32((adapter), (addr))
-#define rtw_read_port(adapter, addr, cnt, mem)                         \
-       _rtw_read_port((adapter), (addr), (cnt), (mem))
 #define rtw_read_port_cancel(adapter) _rtw_read_port_cancel((adapter))
 
 #define  rtw_write8(adapter, addr, val)                                        \
index c0fa8fdb9d92302e688c8b61c648d3a19d9b4370..64dfc02ad08a98f72af92fb745d8ca6572c20bd9 100644 (file)
@@ -199,7 +199,7 @@ void rtw_os_read_port(struct adapter *padapter, struct recv_buf *precvbuf)
        dev_kfree_skb_any(precvbuf->pskb);
        precvbuf->pskb = NULL;
        precvbuf->reuse = false;
-       rtw_read_port(padapter, precvpriv->ff_hwaddr, 0,
+       usb_read_port(padapter, precvpriv->ff_hwaddr, 0,
                        (unsigned char *)precvbuf);
 }