From: Martin Kaiser <martin@kaiser.cx>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Larry Finger <Larry.Finger@lwfinger.net>,
Phillip Potter <phil@philpotter.co.uk>,
Michael Straube <straube.linux@gmail.com>,
linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org,
Martin Kaiser <martin@kaiser.cx>
Subject: [PATCH 5/5] staging: r8188eu: remove ishighspeed from dvobj_priv
Date: Sun, 6 Feb 2022 18:59:25 +0100 [thread overview]
Message-ID: <20220206175925.461426-6-martin@kaiser.cx> (raw)
In-Reply-To: <20220206175925.461426-1-martin@kaiser.cx>
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@kaiser.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
next prev parent reply other threads:[~2022-02-06 17:59 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-06 17:59 [PATCH 0/5] staging: r8188eu: clean up struct dvobj_priv Martin Kaiser
2022-02-06 17:59 ` [PATCH 1/5] staging: r8188eu: usb_vendor_req_mutex is not used Martin Kaiser
2022-02-06 17:59 ` [PATCH 2/5] staging: r8188eu: dvobj_priv's signal_strength " Martin Kaiser
2022-02-06 17:59 ` [PATCH 3/5] staging: r8188eu: RegUsbSS " Martin Kaiser
2022-02-06 17:59 ` [PATCH 4/5] staging: r8188eu: usb_suspend_sema is initialised but " Martin Kaiser
2022-02-06 17:59 ` Martin Kaiser [this message]
2022-02-08 9:30 ` [PATCH 5/5] staging: r8188eu: remove ishighspeed from dvobj_priv Greg Kroah-Hartman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220206175925.461426-6-martin@kaiser.cx \
--to=martin@kaiser.cx \
--cc=Larry.Finger@lwfinger.net \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=phil@philpotter.co.uk \
--cc=straube.linux@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®