usb: gadget: Add match_ep() op to usb_gadget_ops
Add match_ep() op to usb_gadget_ops similar to Linux kernel which is useful in finding a suitable ep match for the function driver. This will avoid adding more gadget_is_xxx() handling code to usb_ep_autoconfig(). Also sync usb_ep_caps struct thats is usually used in the match_ep() callback by the gadget controller driver Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
This commit is contained in:
committed by
Marek Vasut
parent
c93e305af7
commit
77dcbdf3c1
@@ -282,6 +282,9 @@ struct usb_ep *usb_ep_autoconfig(
|
||||
return ep;
|
||||
}
|
||||
|
||||
if (gadget->ops->match_ep)
|
||||
ep = gadget->ops->match_ep(gadget, desc, NULL);
|
||||
|
||||
/* Second, look at endpoints until an unclaimed one looks usable */
|
||||
list_for_each_entry(ep, &gadget->ep_list, ep_list) {
|
||||
if (ep_matches(gadget, ep, desc))
|
||||
|
||||
Reference in New Issue
Block a user