staging: rtl8188eu: 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. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20210407170531.29356-5-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
b048a8db29
commit
889ed8b5e3
@ -249,18 +249,20 @@ usbctrl_vendorreq(struct adapter *adapt, u16 value, void *pdata, u16 len, u8 req
|
||||
goto release_mutex;
|
||||
}
|
||||
|
||||
while (++vendorreq_times <= MAX_USBCTRL_VENDORREQ_TIMES) {
|
||||
memset(pIo_buf, 0, len);
|
||||
if (reqtype == REALTEK_USB_VENQT_READ) {
|
||||
pipe = usb_rcvctrlpipe(udev, 0);
|
||||
} else if (reqtype == REALTEK_USB_VENQT_WRITE) {
|
||||
pipe = usb_sndctrlpipe(udev, 0);
|
||||
} else {
|
||||
status = -EINVAL;
|
||||
goto free_buf;
|
||||
}
|
||||
|
||||
if (reqtype == REALTEK_USB_VENQT_READ) {
|
||||
pipe = usb_rcvctrlpipe(udev, 0);/* read_in */
|
||||
} else if (reqtype == REALTEK_USB_VENQT_WRITE) {
|
||||
pipe = usb_sndctrlpipe(udev, 0);/* write_out */
|
||||
while (++vendorreq_times <= MAX_USBCTRL_VENDORREQ_TIMES) {
|
||||
if (reqtype == REALTEK_USB_VENQT_READ)
|
||||
memset(pIo_buf, 0, len);
|
||||
else
|
||||
memcpy(pIo_buf, pdata, len);
|
||||
} else {
|
||||
status = -EINVAL;
|
||||
goto free_buf;
|
||||
}
|
||||
|
||||
status = usb_control_msg(udev, pipe, REALTEK_USB_VENQT_CMD_REQ,
|
||||
reqtype, value, REALTEK_USB_VENQT_CMD_IDX,
|
||||
|
Loading…
x
Reference in New Issue
Block a user