mirror of
				https://github.com/smaeul/u-boot.git
				synced 2025-11-04 05:50:17 +00:00 
			
		
		
		
	usb: ci_udc: remove controller.items array
There's no need to store an array of QTD pointers in the controller. Since the calculation is so simple, just have ci_get_qtd() perform it at run-time, rather than pre-calculating everything. Signed-off-by: Stephen Warren <swarren@nvidia.com>
This commit is contained in:
		
							parent
							
								
									7e54188775
								
							
						
					
					
						commit
						6ac15fda4e
					
				@ -146,7 +146,9 @@ static struct ept_queue_head *ci_get_qh(int ep_num, int dir_in)
 | 
				
			|||||||
 */
 | 
					 */
 | 
				
			||||||
static struct ept_queue_item *ci_get_qtd(int ep_num, int dir_in)
 | 
					static struct ept_queue_item *ci_get_qtd(int ep_num, int dir_in)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	return controller.items[(ep_num * 2) + dir_in];
 | 
						int index = (ep_num * 2) + dir_in;
 | 
				
			||||||
 | 
						uint8_t *imem = controller.items_mem + (index * ILIST_ENT_SZ);
 | 
				
			||||||
 | 
						return (struct ept_queue_item *)imem;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
@ -790,7 +792,6 @@ static int ci_pullup(struct usb_gadget *gadget, int is_on)
 | 
				
			|||||||
static int ci_udc_probe(void)
 | 
					static int ci_udc_probe(void)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	struct ept_queue_head *head;
 | 
						struct ept_queue_head *head;
 | 
				
			||||||
	uint8_t *imem;
 | 
					 | 
				
			||||||
	int i;
 | 
						int i;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	const int num = 2 * NUM_ENDPOINTS;
 | 
						const int num = 2 * NUM_ENDPOINTS;
 | 
				
			||||||
@ -831,9 +832,6 @@ static int ci_udc_probe(void)
 | 
				
			|||||||
		head->next = TERMINATE;
 | 
							head->next = TERMINATE;
 | 
				
			||||||
		head->info = 0;
 | 
							head->info = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		imem = controller.items_mem + (i * ILIST_ENT_SZ);
 | 
					 | 
				
			||||||
		controller.items[i] = (struct ept_queue_item *)imem;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		if (i & 1) {
 | 
							if (i & 1) {
 | 
				
			||||||
			ci_flush_qh(i / 2);
 | 
								ci_flush_qh(i / 2);
 | 
				
			||||||
			ci_flush_qtd(i / 2);
 | 
								ci_flush_qtd(i / 2);
 | 
				
			||||||
 | 
				
			|||||||
@ -102,7 +102,6 @@ struct ci_drv {
 | 
				
			|||||||
	struct usb_gadget_driver	*driver;
 | 
						struct usb_gadget_driver	*driver;
 | 
				
			||||||
	struct ehci_ctrl		*ctrl;
 | 
						struct ehci_ctrl		*ctrl;
 | 
				
			||||||
	struct ept_queue_head		*epts;
 | 
						struct ept_queue_head		*epts;
 | 
				
			||||||
	struct ept_queue_item		*items[2 * NUM_ENDPOINTS];
 | 
					 | 
				
			||||||
	uint8_t				*items_mem;
 | 
						uint8_t				*items_mem;
 | 
				
			||||||
	struct ci_ep			ep[NUM_ENDPOINTS];
 | 
						struct ci_ep			ep[NUM_ENDPOINTS];
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user