Commit 7f2958d9 authored by Thinh Nguyen's avatar Thinh Nguyen Committed by Felipe Balbi

usb: dwc3: gadget: Rename misleading function names

The functions dwc3_prepare_one_trb_sg and dwc3_prepare_one_trb_linear
are not necessarily preparing "one" TRB, it can prepare multiple TRBs.
Rename these functions as follow:

dwc3_prepare_one_trb_sg -> dwc3_prepare_trbs_sg
dwc3_prepare_one_trb_linear -> dwc3_prepare_trbs_linear
Signed-off-by: default avatarThinh Nguyen <Thinh.Nguyen@synopsys.com>
Signed-off-by: default avatarFelipe Balbi <balbi@kernel.org>
parent cb1b3997
...@@ -1135,7 +1135,7 @@ static int dwc3_prepare_last_sg(struct dwc3_ep *dep, ...@@ -1135,7 +1135,7 @@ static int dwc3_prepare_last_sg(struct dwc3_ep *dep,
return num_trbs; return num_trbs;
} }
static int dwc3_prepare_one_trb_sg(struct dwc3_ep *dep, static int dwc3_prepare_trbs_sg(struct dwc3_ep *dep,
struct dwc3_request *req) struct dwc3_request *req)
{ {
struct scatterlist *sg = req->start_sg; struct scatterlist *sg = req->start_sg;
...@@ -1231,7 +1231,7 @@ static int dwc3_prepare_one_trb_sg(struct dwc3_ep *dep, ...@@ -1231,7 +1231,7 @@ static int dwc3_prepare_one_trb_sg(struct dwc3_ep *dep,
return req->num_trbs - num_trbs; return req->num_trbs - num_trbs;
} }
static int dwc3_prepare_one_trb_linear(struct dwc3_ep *dep, static int dwc3_prepare_trbs_linear(struct dwc3_ep *dep,
struct dwc3_request *req) struct dwc3_request *req)
{ {
return dwc3_prepare_last_sg(dep, req, req->request.length, 0); return dwc3_prepare_last_sg(dep, req, req->request.length, 0);
...@@ -1266,7 +1266,7 @@ static int dwc3_prepare_trbs(struct dwc3_ep *dep) ...@@ -1266,7 +1266,7 @@ static int dwc3_prepare_trbs(struct dwc3_ep *dep)
*/ */
list_for_each_entry(req, &dep->started_list, list) { list_for_each_entry(req, &dep->started_list, list) {
if (req->num_pending_sgs > 0) { if (req->num_pending_sgs > 0) {
ret = dwc3_prepare_one_trb_sg(dep, req); ret = dwc3_prepare_trbs_sg(dep, req);
if (!ret) if (!ret)
return ret; return ret;
} }
...@@ -1297,9 +1297,9 @@ static int dwc3_prepare_trbs(struct dwc3_ep *dep) ...@@ -1297,9 +1297,9 @@ static int dwc3_prepare_trbs(struct dwc3_ep *dep)
req->num_pending_sgs = req->request.num_mapped_sgs; req->num_pending_sgs = req->request.num_mapped_sgs;
if (req->num_pending_sgs > 0) if (req->num_pending_sgs > 0)
ret = dwc3_prepare_one_trb_sg(dep, req); ret = dwc3_prepare_trbs_sg(dep, req);
else else
ret = dwc3_prepare_one_trb_linear(dep, req); ret = dwc3_prepare_trbs_linear(dep, req);
if (!ret || !dwc3_calc_trbs_left(dep)) if (!ret || !dwc3_calc_trbs_left(dep))
return ret; return ret;
......
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