usb: gadget: move find_ep() from epautoconf to udc-core

Move find_ep() to udc-core and rename it to gadget_find_ep_by_name().
It can be used in UDC drivers, especially in 'match_ep' callback after
moving chip-specific endpoint matching logic from epautoconf to UDC
drivers.

Replace all calls of find_ep() function with gadget_find_ep_by_name().

Signed-off-by: Robert Baldyga <r.baldyga@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
This commit is contained in:
Robert Baldyga
2015-08-06 14:11:12 +02:00
committed by Felipe Balbi
parent 4278c687f6
commit b0aea0037c
3 changed files with 37 additions and 22 deletions

View File

@@ -639,7 +639,6 @@ static inline struct usb_gadget *dev_to_usb_gadget(struct device *dev)
#define gadget_for_each_ep(tmp, gadget) \
list_for_each_entry(tmp, &(gadget)->ep_list, ep_list)
/**
* usb_ep_align_maybe - returns @len aligned to ep's maxpacketsize if gadget
* requires quirk_ep_out_aligned_size, otherwise reguens len.
@@ -1204,6 +1203,13 @@ extern void usb_gadget_giveback_request(struct usb_ep *ep,
/*-------------------------------------------------------------------------*/
/* utility to find endpoint by name */
extern struct usb_ep *gadget_find_ep_by_name(struct usb_gadget *g,
const char *name);
/*-------------------------------------------------------------------------*/
/* utility to check if endpoint caps match descriptor needs */
extern int usb_gadget_ep_match_desc(struct usb_gadget *gadget,