staging: r8188eu: pnp_bstop_trx is never set
authorMichael Straube <straube.linux@gmail.com>
Mon, 4 Apr 2022 08:21:40 +0000 (10:21 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 4 Apr 2022 14:34:52 +0000 (16:34 +0200)
The field pnp_bstop_trx in struct pwrctrl_priv is never set. It stays
at its default value 0. Remove it and remove related dead code.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220404082142.4639-4-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/r8188eu/hal/usb_ops_linux.c
drivers/staging/r8188eu/include/rtw_pwrctrl.h
drivers/staging/r8188eu/os_dep/usb_ops_linux.c

index e5d6cd6228f227a690bf6c386f8d1f4fe754c9ec..6a65dcf571127e9c7054613dac72563da099de74 100644 (file)
@@ -16,7 +16,7 @@ static int usb_read(struct intf_hdl *intf, u16 value, void *data, u8 size)
        int status;
        u8 io_buf[4];
 
-       if (adapt->bSurpriseRemoved || adapt->pwrctrlpriv.pnp_bstop_trx)
+       if (adapt->bSurpriseRemoved)
                return -EPERM;
 
        status = usb_control_msg_recv(udev, 0, REALTEK_USB_VENQT_CMD_REQ,
@@ -59,7 +59,7 @@ static int usb_write(struct intf_hdl *intf, u16 value, void *data, u8 size)
        int status;
        u8 io_buf[VENDOR_CMD_MAX_DATA_LEN];
 
-       if (adapt->bSurpriseRemoved || adapt->pwrctrlpriv.pnp_bstop_trx)
+       if (adapt->bSurpriseRemoved)
                return -EPERM;
 
        memcpy(io_buf, data, size);
@@ -414,8 +414,7 @@ u32 rtw_read_port(struct adapter *adapter, u8 *rmem)
        size_t alignment = 0;
        u32 ret = _SUCCESS;
 
-       if (adapter->bDriverStopped || adapter->bSurpriseRemoved ||
-           adapter->pwrctrlpriv.pnp_bstop_trx)
+       if (adapter->bDriverStopped || adapter->bSurpriseRemoved)
                return _FAIL;
 
        if (!precvbuf)
index 3efcc65b2f6e4ea3f1723c4fede185c590c74c86..94a65056a77ea27279056cf143308f8b1bc2f2a9 100644 (file)
@@ -64,7 +64,6 @@ struct pwrctrl_priv {
        u8      power_mgnt;
        u8      bFwCurrentInPSMode;
        u32     DelayLPSLastTimeStamp;
-       u8              pnp_bstop_trx;
 
        u8              bInSuspend;
        u8              bSupportRemoteWakeup;
index c4b6dbc8d66dd075262c443ee718c7b7d8371fbb..8ca16861bfcc75d896689712f5c951967cb522a2 100644 (file)
@@ -106,8 +106,7 @@ u32 rtw_write_port(struct adapter *padapter, u32 addr, u32 cnt, u8 *wmem)
        struct xmit_frame *pxmitframe = (struct xmit_frame *)pxmitbuf->priv_data;
        struct usb_device *pusbd = pdvobj->pusbdev;
 
-       if ((padapter->bDriverStopped) || (padapter->bSurpriseRemoved) ||
-           (padapter->pwrctrlpriv.pnp_bstop_trx)) {
+       if (padapter->bDriverStopped || padapter->bSurpriseRemoved) {
                rtw_sctx_done_err(&pxmitbuf->sctx, RTW_SCTX_DONE_TX_DENY);
                goto exit;
        }