2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-23 20:53:53 +08:00

staging: r8188eu: set pipe only once

Set the pipe for reading or writing in usbctrl_vendorreq only once.
There's no need to set it again for every retry.

This patch is an adaptation of commit 889ed8b5e3 ("staging: rtl8188eu:
set pipe only once") for the new r8188eu driver.

Acked-by: Phillip Potter <phil@philpotter.co.uk>
Acked-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20210821164859.4351-10-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Martin Kaiser 2021-08-21 18:48:59 +02:00 committed by Greg Kroah-Hartman
parent f7231a04e4
commit 5598e47a79

View File

@ -40,15 +40,16 @@ static int usbctrl_vendorreq(struct intf_hdl *pintfhdl, u16 value, void *pdata,
goto release_mutex;
}
while (++vendorreq_times <= MAX_USBCTRL_VENDORREQ_TIMES) {
memset(pIo_buf, 0, len);
if (requesttype == REALTEK_USB_VENQT_READ)
pipe = usb_rcvctrlpipe(udev, 0);/* read_in */
else
pipe = usb_sndctrlpipe(udev, 0);/* write_out */
if (requesttype == REALTEK_USB_VENQT_READ) {
pipe = usb_rcvctrlpipe(udev, 0);/* read_in */
} else {
pipe = usb_sndctrlpipe(udev, 0);/* write_out */
while (++vendorreq_times <= MAX_USBCTRL_VENDORREQ_TIMES) {
if (requesttype == REALTEK_USB_VENQT_READ)
memset(pIo_buf, 0, len);
else
memcpy(pIo_buf, pdata, len);
}
status = usb_control_msg(udev, pipe, REALTEK_USB_VENQT_CMD_REQ,
requesttype, value, REALTEK_USB_VENQT_CMD_IDX,