aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Grzeschik <[email protected]>2022-03-06 22:12:50 +0100
committerGreg Kroah-Hartman <[email protected]>2022-03-15 18:42:32 +0100
commit26d27a1080a7d0e8f0c1a56dc50aae336f9525d1 (patch)
treeaed0c3f0516975c56447f80a3f62d5feb05a23b4
parentcee03ca3cb44c867b45f9d32601c1d532f66fe7a (diff)
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 <[email protected]> Signed-off-by: Michael Grzeschik <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
-rw-r--r--drivers/usb/dwc3/gadget.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
index eb88ef5dd16f..416187189bdd 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -1919,13 +1919,11 @@ static int __dwc3_gadget_ep_queue(struct dwc3_ep *dep, struct dwc3_request *req)
* errors which will force us issue EndTransfer command.
*/
if (usb_endpoint_xfer_isoc(dep->endpoint.desc)) {
- if (!(dep->flags & DWC3_EP_PENDING_REQUEST) &&
- !(dep->flags & DWC3_EP_TRANSFER_STARTED))
- return 0;
-
- if ((dep->flags & DWC3_EP_PENDING_REQUEST)) {
- if (!(dep->flags & DWC3_EP_TRANSFER_STARTED))
+ if (!(dep->flags & DWC3_EP_TRANSFER_STARTED)) {
+ if ((dep->flags & DWC3_EP_PENDING_REQUEST))
return __dwc3_gadget_start_isoc(dep);
+
+ return 0;
}
}