mirror of
				git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
				synced 2025-09-04 20:19:47 +08:00 
			
		
		
		
	usb: dwc3: gadget: split dwc3_gadget_ep_cleanup_completed_requests()
No functional changes, it just makes the code slightly easier to read. Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
This commit is contained in:
		
							parent
							
								
									6d9d22dac1
								
							
						
					
					
						commit
						f38e35dd84
					
				| @ -2308,13 +2308,10 @@ static bool dwc3_gadget_ep_request_completed(struct dwc3_request *req) | |||||||
| 	return req->request.actual == req->request.length; | 	return req->request.actual == req->request.length; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| static void dwc3_gadget_ep_cleanup_completed_requests(struct dwc3_ep *dep, | static int dwc3_gadget_ep_cleanup_completed_request(struct dwc3_ep *dep, | ||||||
| 		const struct dwc3_event_depevt *event, int status) | 		const struct dwc3_event_depevt *event, | ||||||
|  | 		struct dwc3_request *req, int status) | ||||||
| { | { | ||||||
| 	struct dwc3_request	*req; |  | ||||||
| 	struct dwc3_request	*tmp; |  | ||||||
| 
 |  | ||||||
| 	list_for_each_entry_safe(req, tmp, &dep->started_list, list) { |  | ||||||
| 	int ret; | 	int ret; | ||||||
| 
 | 
 | ||||||
| 	if (req->num_pending_sgs) | 	if (req->num_pending_sgs) | ||||||
| @ -2333,14 +2330,29 @@ static void dwc3_gadget_ep_cleanup_completed_requests(struct dwc3_ep *dep, | |||||||
| 
 | 
 | ||||||
| 	req->request.actual = req->request.length - req->remaining; | 	req->request.actual = req->request.length - req->remaining; | ||||||
| 
 | 
 | ||||||
| 		if (!dwc3_gadget_ep_request_completed(req) || | 	if (!dwc3_gadget_ep_request_completed(req) && | ||||||
| 			req->num_pending_sgs) { | 			req->num_pending_sgs) { | ||||||
| 		__dwc3_gadget_kick_transfer(dep); | 		__dwc3_gadget_kick_transfer(dep); | ||||||
| 			break; | 		goto out; | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	dwc3_gadget_giveback(dep, req, status); | 	dwc3_gadget_giveback(dep, req, status); | ||||||
| 
 | 
 | ||||||
|  | out: | ||||||
|  | 	return ret; | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | static void dwc3_gadget_ep_cleanup_completed_requests(struct dwc3_ep *dep, | ||||||
|  | 		const struct dwc3_event_depevt *event, int status) | ||||||
|  | { | ||||||
|  | 	struct dwc3_request	*req; | ||||||
|  | 	struct dwc3_request	*tmp; | ||||||
|  | 
 | ||||||
|  | 	list_for_each_entry_safe(req, tmp, &dep->started_list, list) { | ||||||
|  | 		int ret; | ||||||
|  | 
 | ||||||
|  | 		ret = dwc3_gadget_ep_cleanup_completed_request(dep, event, | ||||||
|  | 				req, status); | ||||||
| 		if (ret) | 		if (ret) | ||||||
| 			break; | 			break; | ||||||
| 	} | 	} | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 Felipe Balbi
						Felipe Balbi