Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Signed-off-by: Felipe Balbi <balbi@kernel.org>

authored by

Thinh Nguyen and committed by
Felipe Balbi
7f2958d9 cb1b3997

+5 -5
+5 -5
drivers/usb/dwc3/gadget.c
··· 1135 1135 return num_trbs; 1136 1136 } 1137 1137 1138 - static int dwc3_prepare_one_trb_sg(struct dwc3_ep *dep, 1138 + static int dwc3_prepare_trbs_sg(struct dwc3_ep *dep, 1139 1139 struct dwc3_request *req) 1140 1140 { 1141 1141 struct scatterlist *sg = req->start_sg; ··· 1231 1231 return req->num_trbs - num_trbs; 1232 1232 } 1233 1233 1234 - static int dwc3_prepare_one_trb_linear(struct dwc3_ep *dep, 1234 + static int dwc3_prepare_trbs_linear(struct dwc3_ep *dep, 1235 1235 struct dwc3_request *req) 1236 1236 { 1237 1237 return dwc3_prepare_last_sg(dep, req, req->request.length, 0); ··· 1266 1266 */ 1267 1267 list_for_each_entry(req, &dep->started_list, list) { 1268 1268 if (req->num_pending_sgs > 0) { 1269 - ret = dwc3_prepare_one_trb_sg(dep, req); 1269 + ret = dwc3_prepare_trbs_sg(dep, req); 1270 1270 if (!ret) 1271 1271 return ret; 1272 1272 } ··· 1297 1297 req->num_pending_sgs = req->request.num_mapped_sgs; 1298 1298 1299 1299 if (req->num_pending_sgs > 0) 1300 - ret = dwc3_prepare_one_trb_sg(dep, req); 1300 + ret = dwc3_prepare_trbs_sg(dep, req); 1301 1301 else 1302 - ret = dwc3_prepare_one_trb_linear(dep, req); 1302 + ret = dwc3_prepare_trbs_linear(dep, req); 1303 1303 1304 1304 if (!ret || !dwc3_calc_trbs_left(dep)) 1305 1305 return ret;