Skip to contentSkip to conversation

usb/gadget: Add an EP dispose() callback for EP lifetime tracking

PATCH New Greg KH 1 participant 1 message Jan 22, 2018 USB

lore
Share & tools
lore

Greg KH

author
#0 lore raw

PATCH v3 2/3 usb/gadget: Add an EP dispose() callback for EP lifetime tracking

Quoted 13 lines · Benjamin Herrenschmidt

Some UDC may want to allocate endpoints dynamically, either because the HW supports an arbitrary large number or because (like the Aspeed BMC SoCs), the pool of HW endpoints is shared between multiple gadgets.

The allocation side can be done rather easily using the existing match_ep() UDC hook.

However we have no good place to "free" them.

This implements a "simple" variant of this, which calls an EP dispose callback on all EPs associated with a gadget when the composite device gets unbound.

Quoted 7 lines

This is required by my upcoming Aspeed vHub driver.

---
 drivers/usb/gadget/composite.c | 8 ++++++++
 include/linux/usb/gadget.h     | 1 +
 2 files changed, 9 insertions(+)

Any reason you aren't sending these to the maintainer of the usb gadget subsystem? get_maintainer.pl is your friend :)

thanks,

greg k-h
---
To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html