[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220206175925.461426-6-martin@kaiser.cx>
Date: Sun, 6 Feb 2022 18:59:25 +0100
From: Martin Kaiser <martin@...ser.cx>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: Larry Finger <Larry.Finger@...inger.net>,
Phillip Potter <phil@...lpotter.co.uk>,
Michael Straube <straube.linux@...il.com>,
linux-staging@...ts.linux.dev, linux-kernel@...r.kernel.org,
Martin Kaiser <martin@...ser.cx>
Subject: [PATCH 5/5] staging: r8188eu: remove ishighspeed from dvobj_priv
There's no need to store the usb device speed in struct dvobj_priv.
We can read the speed from struct usb_device. dvobj_priv has a pointer
to the usb_device.
Signed-off-by: Martin Kaiser <martin@...ser.cx>
---
drivers/staging/r8188eu/core/rtw_iol.c | 4 +++-
drivers/staging/r8188eu/hal/usb_halinit.c | 4 ++--
drivers/staging/r8188eu/include/drv_types.h | 1 -
drivers/staging/r8188eu/include/usb_ops.h | 2 +-
drivers/staging/r8188eu/os_dep/usb_intf.c | 8 --------
5 files changed, 6 insertions(+), 13 deletions(-)
diff --git a/drivers/staging/r8188eu/core/rtw_iol.c b/drivers/staging/r8188eu/core/rtw_iol.c
index 923da2a9f6ae..26f2a6fc3f38 100644
--- a/drivers/staging/r8188eu/core/rtw_iol.c
+++ b/drivers/staging/r8188eu/core/rtw_iol.c
@@ -68,8 +68,10 @@ bool rtw_IOL_applied(struct adapter *adapter)
if (1 == adapter->registrypriv.fw_iol)
return true;
- if ((2 == adapter->registrypriv.fw_iol) && (!adapter_to_dvobj(adapter)->ishighspeed))
+ if ((2 == adapter->registrypriv.fw_iol) &&
+ (!(adapter_to_dvobj(adapter)->pusbdev->speed == USB_SPEED_HIGH)))
return true;
+
return false;
}
diff --git a/drivers/staging/r8188eu/hal/usb_halinit.c b/drivers/staging/r8188eu/hal/usb_halinit.c
index 03966a1e247e..e3a28c443f24 100644
--- a/drivers/staging/r8188eu/hal/usb_halinit.c
+++ b/drivers/staging/r8188eu/hal/usb_halinit.c
@@ -48,7 +48,7 @@ void rtl8188eu_interface_configure(struct adapter *adapt)
struct hal_data_8188e *haldata = &adapt->haldata;
struct dvobj_priv *pdvobjpriv = adapter_to_dvobj(adapt);
- if (pdvobjpriv->ishighspeed)
+ if (pdvobjpriv->pusbdev->speed == USB_SPEED_HIGH)
haldata->UsbBulkOutSize = USB_HIGH_SPEED_BULK_SIZE;/* 512 bytes */
else
haldata->UsbBulkOutSize = USB_FULL_SPEED_BULK_SIZE;/* 64 bytes */
@@ -105,7 +105,7 @@ static void _InitInterrupt(struct adapter *Adapter)
/* 1; Use bulk endpoint to upload interrupt pkt, */
usb_opt = rtw_read8(Adapter, REG_USB_SPECIAL_OPTION);
- if (!adapter_to_dvobj(Adapter)->ishighspeed)
+ if (!(adapter_to_dvobj(Adapter)->pusbdev->speed == USB_SPEED_HIGH))
usb_opt = usb_opt & (~INT_BULK_SEL);
else
usb_opt = usb_opt | (INT_BULK_SEL);
diff --git a/drivers/staging/r8188eu/include/drv_types.h b/drivers/staging/r8188eu/include/drv_types.h
index 618a6529192b..894e70a0d506 100644
--- a/drivers/staging/r8188eu/include/drv_types.h
+++ b/drivers/staging/r8188eu/include/drv_types.h
@@ -137,7 +137,6 @@ struct dvobj_priv {
/*-------- below is for USB INTERFACE --------*/
- u8 ishighspeed;
u8 RtNumOutPipes;
struct usb_interface *pusbintf;
diff --git a/drivers/staging/r8188eu/include/usb_ops.h b/drivers/staging/r8188eu/include/usb_ops.h
index 0a1155bbc7b8..62e4706c0497 100644
--- a/drivers/staging/r8188eu/include/usb_ops.h
+++ b/drivers/staging/r8188eu/include/usb_ops.h
@@ -55,7 +55,7 @@ static inline u8 rtw_usb_bulk_size_boundary(struct adapter *padapter,
u8 rst = true;
struct dvobj_priv *pdvobjpriv = adapter_to_dvobj(padapter);
- if (pdvobjpriv->ishighspeed)
+ if (pdvobjpriv->pusbdev->speed == USB_SPEED_HIGH)
rst = (0 == (buf_len) % USB_HIGH_SPEED_BULK_SIZE) ?
true : false;
else
diff --git a/drivers/staging/r8188eu/os_dep/usb_intf.c b/drivers/staging/r8188eu/os_dep/usb_intf.c
index 10c33e2ae3bc..cd7f28d25c47 100644
--- a/drivers/staging/r8188eu/os_dep/usb_intf.c
+++ b/drivers/staging/r8188eu/os_dep/usb_intf.c
@@ -117,14 +117,6 @@ static struct dvobj_priv *usb_dvobj_init(struct usb_interface *usb_intf)
if (rt_num_in_pipes != 1)
goto err;
- if (pusbd->speed == USB_SPEED_HIGH) {
- pdvobjpriv->ishighspeed = true;
- DBG_88E("USB_SPEED_HIGH\n");
- } else {
- pdvobjpriv->ishighspeed = false;
- DBG_88E("NON USB_SPEED_HIGH\n");
- }
-
/* 3 misc */
rtw_reset_continual_urb_error(pdvobjpriv);
--
2.30.2
Powered by blists - more mailing lists