Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

usb: gadget: epautoconf: add usb_ep_autoconfig_release() function

This patch introduces usb_ep_autoconfig_release() function which allows
to release endpoint previously obtained from usb_ep_autoconfig() during
USB function bind.

Signed-off-by: Robert Baldyga <r.baldyga@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>

authored by

Robert Baldyga and committed by
Felipe Balbi
b67f628c 35bfde36

+19
+17
drivers/usb/gadget/epautoconf.c
··· 172 172 EXPORT_SYMBOL_GPL(usb_ep_autoconfig); 173 173 174 174 /** 175 + * usb_ep_autoconfig_release - releases endpoint and set it to initial state 176 + * @ep: endpoint which should be released 177 + * 178 + * This function can be used during function bind for endpoints obtained 179 + * from usb_ep_autoconfig(). It unclaims endpoint claimed by 180 + * usb_ep_autoconfig() to make it available for other functions. Endpoint 181 + * which was released is no longer invalid and shouldn't be used in 182 + * context of function which released it. 183 + */ 184 + void usb_ep_autoconfig_release(struct usb_ep *ep) 185 + { 186 + ep->claimed = false; 187 + ep->driver_data = NULL; 188 + } 189 + EXPORT_SYMBOL_GPL(usb_ep_autoconfig_release); 190 + 191 + /** 175 192 * usb_ep_autoconfig_reset - reset endpoint autoconfig state 176 193 * @gadget: device for which autoconfig state will be reset 177 194 *
+2
include/linux/usb/gadget.h
··· 1233 1233 struct usb_endpoint_descriptor *, 1234 1234 struct usb_ss_ep_comp_descriptor *); 1235 1235 1236 + extern void usb_ep_autoconfig_release(struct usb_ep *); 1237 + 1236 1238 extern void usb_ep_autoconfig_reset(struct usb_gadget *); 1237 1239 1238 1240 #endif /* __LINUX_USB_GADGET_H */