mirror of
https://github.com/torvalds/linux.git
synced 2026-05-31 10:33:41 +02:00
usb: dwc3: gadget: Remove dwc3_request->needs_extra_trb
Now that we track TRBs base on request->num_trbs on reclaim, we don't need to save the dwc3_request->needs_extra_trb check. Remove it. Signed-off-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com> Link: https://lore.kernel.org/r/08dd88a3308ac7894267c52340eaf0e1564bbf36.1731545781.git.Thinh.Nguyen@synopsys.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
61440628a4
commit
f5313c8b41
|
|
@ -949,8 +949,6 @@ struct dwc3_hwparams {
|
|||
* @trb: pointer to struct dwc3_trb
|
||||
* @trb_dma: DMA address of @trb
|
||||
* @num_trbs: number of TRBs used by this request
|
||||
* @needs_extra_trb: true when request needs one extra TRB (either due to ZLP
|
||||
* or unaligned OUT)
|
||||
* @direction: IN or OUT direction flag
|
||||
* @mapped: true when request has been dma-mapped
|
||||
*/
|
||||
|
|
@ -979,7 +977,6 @@ struct dwc3_request {
|
|||
|
||||
unsigned int num_trbs;
|
||||
|
||||
unsigned int needs_extra_trb:1;
|
||||
unsigned int direction:1;
|
||||
unsigned int mapped:1;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -197,7 +197,6 @@ static void dwc3_gadget_del_and_unmap_request(struct dwc3_ep *dep,
|
|||
|
||||
list_del(&req->list);
|
||||
req->remaining = 0;
|
||||
req->needs_extra_trb = false;
|
||||
req->num_trbs = 0;
|
||||
|
||||
if (req->request.status == -EINPROGRESS)
|
||||
|
|
@ -1440,6 +1439,7 @@ static int dwc3_prepare_last_sg(struct dwc3_ep *dep,
|
|||
unsigned int maxp = usb_endpoint_maxp(dep->endpoint.desc);
|
||||
unsigned int rem = req->request.length % maxp;
|
||||
unsigned int num_trbs = 1;
|
||||
bool needs_extra_trb;
|
||||
|
||||
if (dwc3_needs_extra_trb(dep, req))
|
||||
num_trbs++;
|
||||
|
|
@ -1447,15 +1447,15 @@ static int dwc3_prepare_last_sg(struct dwc3_ep *dep,
|
|||
if (dwc3_calc_trbs_left(dep) < num_trbs)
|
||||
return 0;
|
||||
|
||||
req->needs_extra_trb = num_trbs > 1;
|
||||
needs_extra_trb = num_trbs > 1;
|
||||
|
||||
/* Prepare a normal TRB */
|
||||
if (req->direction || req->request.length)
|
||||
dwc3_prepare_one_trb(dep, req, entry_length,
|
||||
req->needs_extra_trb, node, false, false);
|
||||
needs_extra_trb, node, false, false);
|
||||
|
||||
/* Prepare extra TRBs for ZLP and MPS OUT transfer alignment */
|
||||
if ((!req->direction && !req->request.length) || req->needs_extra_trb)
|
||||
if ((!req->direction && !req->request.length) || needs_extra_trb)
|
||||
dwc3_prepare_one_trb(dep, req,
|
||||
req->direction ? 0 : maxp - rem,
|
||||
false, 1, true, false);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user