Commit 66f5dd5a authored by Felipe Balbi's avatar Felipe Balbi

usb: dwc3: gadget: rename done_trbs and done_reqs

This patch simply renames two functions to more descriptive names so
that it's easier to understand what they're doing.

Cleanup only, no functional changes.
Signed-off-by: default avatarFelipe Balbi <felipe.balbi@linux.intel.com>
parent a861282f
...@@ -2248,10 +2248,10 @@ static void dwc3_gadget_free_endpoints(struct dwc3 *dwc) ...@@ -2248,10 +2248,10 @@ static void dwc3_gadget_free_endpoints(struct dwc3 *dwc)
/* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */
static int __dwc3_cleanup_done_trbs(struct dwc3 *dwc, struct dwc3_ep *dep, static int dwc3_gadget_ep_reclaim_completed_trbs(struct dwc3 *dwc,
struct dwc3_request *req, struct dwc3_trb *trb, struct dwc3_ep *dep, struct dwc3_request *req,
const struct dwc3_event_depevt *event, int status, struct dwc3_trb *trb, const struct dwc3_event_depevt *event,
int chain) int status, int chain)
{ {
unsigned int count; unsigned int count;
unsigned int s_pkt = 0; unsigned int s_pkt = 0;
...@@ -2336,8 +2336,9 @@ static int __dwc3_cleanup_done_trbs(struct dwc3 *dwc, struct dwc3_ep *dep, ...@@ -2336,8 +2336,9 @@ static int __dwc3_cleanup_done_trbs(struct dwc3 *dwc, struct dwc3_ep *dep,
return 0; return 0;
} }
static int dwc3_cleanup_done_reqs(struct dwc3 *dwc, struct dwc3_ep *dep, static int dwc3_gadget_ep_cleanup_completed_requests(struct dwc3 *dwc,
const struct dwc3_event_depevt *event, int status) struct dwc3_ep *dep, const struct dwc3_event_depevt *event,
int status)
{ {
struct dwc3_request *req, *n; struct dwc3_request *req, *n;
struct dwc3_trb *trb; struct dwc3_trb *trb;
...@@ -2365,21 +2366,22 @@ static int dwc3_cleanup_done_reqs(struct dwc3 *dwc, struct dwc3_ep *dep, ...@@ -2365,21 +2366,22 @@ static int dwc3_cleanup_done_reqs(struct dwc3 *dwc, struct dwc3_ep *dep,
req->sg = sg_next(s); req->sg = sg_next(s);
req->num_pending_sgs--; req->num_pending_sgs--;
ret = __dwc3_cleanup_done_trbs(dwc, dep, req, trb, ret = dwc3_gadget_ep_reclaim_completed_trbs(dwc,
event, status, chain); dep, req, trb, event, status,
chain);
if (ret) if (ret)
break; break;
} }
} else { } else {
trb = &dep->trb_pool[dep->trb_dequeue]; trb = &dep->trb_pool[dep->trb_dequeue];
ret = __dwc3_cleanup_done_trbs(dwc, dep, req, trb, ret = dwc3_gadget_ep_reclaim_completed_trbs(dwc, dep,
event, status, chain); req, trb, event, status, chain);
} }
if (req->unaligned || req->zero) { if (req->unaligned || req->zero) {
trb = &dep->trb_pool[dep->trb_dequeue]; trb = &dep->trb_pool[dep->trb_dequeue];
ret = __dwc3_cleanup_done_trbs(dwc, dep, req, trb, ret = dwc3_gadget_ep_reclaim_completed_trbs(dwc, dep,
event, status, false); req, trb, event, status, false);
req->unaligned = false; req->unaligned = false;
req->zero = false; req->zero = false;
} }
...@@ -2450,7 +2452,8 @@ static void dwc3_gadget_endpoint_transfer_in_progress(struct dwc3 *dwc, ...@@ -2450,7 +2452,8 @@ static void dwc3_gadget_endpoint_transfer_in_progress(struct dwc3 *dwc,
if (event->status & DEPEVT_STATUS_BUSERR) if (event->status & DEPEVT_STATUS_BUSERR)
status = -ECONNRESET; status = -ECONNRESET;
clean_busy = dwc3_cleanup_done_reqs(dwc, dep, event, status); clean_busy = dwc3_gadget_ep_cleanup_completed_requests(dwc, dep, event,
status);
if (clean_busy && (!dep->endpoint.desc || if (clean_busy && (!dep->endpoint.desc ||
usb_endpoint_xfer_isoc(dep->endpoint.desc))) usb_endpoint_xfer_isoc(dep->endpoint.desc)))
dep->flags &= ~DWC3_EP_BUSY; dep->flags &= ~DWC3_EP_BUSY;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment