Skip to content

Commit 26d27a1

Browse files
Michael Grzeschikgregkh
authored andcommitted
usb: dwc3: gadget: ep_queue simplify isoc start condition
To improve reading the code this patch moves the cases to start_isoc or return the function under one common condition check. Reviewed-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com> Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de> Link: https://lore.kernel.org/r/20220306211251.2281335-2-m.grzeschik@pengutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent cee03ca commit 26d27a1

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

drivers/usb/dwc3/gadget.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1919,13 +1919,11 @@ static int __dwc3_gadget_ep_queue(struct dwc3_ep *dep, struct dwc3_request *req)
19191919
* errors which will force us issue EndTransfer command.
19201920
*/
19211921
if (usb_endpoint_xfer_isoc(dep->endpoint.desc)) {
1922-
if (!(dep->flags & DWC3_EP_PENDING_REQUEST) &&
1923-
!(dep->flags & DWC3_EP_TRANSFER_STARTED))
1924-
return 0;
1925-
1926-
if ((dep->flags & DWC3_EP_PENDING_REQUEST)) {
1927-
if (!(dep->flags & DWC3_EP_TRANSFER_STARTED))
1922+
if (!(dep->flags & DWC3_EP_TRANSFER_STARTED)) {
1923+
if ((dep->flags & DWC3_EP_PENDING_REQUEST))
19281924
return __dwc3_gadget_start_isoc(dep);
1925+
1926+
return 0;
19291927
}
19301928
}
19311929

0 commit comments

Comments
 (0)