mirror of https://github.com/OpenIPC/firmware.git
				
				
				
			
		
			
				
	
	
		
			23 lines
		
	
	
		
			760 B
		
	
	
	
		
			Diff
		
	
	
			
		
		
	
	
			23 lines
		
	
	
		
			760 B
		
	
	
	
		
			Diff
		
	
	
| --- linux-4.9.37/drivers/usb/gadget/epautoconf.c	2017-07-12 16:42:41.000000000 +0300
 | |
| +++ linux-4.9.y/drivers/usb/gadget/epautoconf.c	2021-06-07 13:01:34.000000000 +0300
 | |
| @@ -82,9 +82,16 @@
 | |
|  	}
 | |
|  
 | |
|  	/* Second, look at endpoints until an unclaimed one looks usable */
 | |
| -	list_for_each_entry (ep, &gadget->ep_list, ep_list) {
 | |
| -		if (usb_gadget_ep_match_desc(gadget, ep, desc, ep_comp))
 | |
| -			goto found_ep;
 | |
| +	if (type == USB_ENDPOINT_XFER_INT) {
 | |
| +		list_for_each_entry_reverse(ep, &gadget->ep_list, ep_list) {
 | |
| +			if (usb_gadget_ep_match_desc(gadget, ep, desc, ep_comp))
 | |
| +				goto found_ep;
 | |
| +		}
 | |
| +	} else {
 | |
| +		list_for_each_entry(ep, &gadget->ep_list, ep_list) {
 | |
| +			if (usb_gadget_ep_match_desc(gadget, ep, desc, ep_comp))
 | |
| +				goto found_ep;
 | |
| +		}
 | |
|  	}
 | |
|  
 | |
|  	/* Fail */
 |