summaryrefslogtreecommitdiff
path: root/drivers/usb
diff options
context:
space:
mode:
authorMichal Sojka <sojka@merica.cz>2014-09-24 22:43:18 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-09-25 16:58:17 +0200
commit3fc2aa5522ab958374d93ef5d2e12df7ee233c91 (patch)
tree65ffb2f11379a88d4b7aee17e47496c0677b1e61 /drivers/usb
parent1b59fc7e3cda3f626204cadda8bb9b7d15f4f55b (diff)
usb: gadget: Introduce usb_gadget_giveback_request()
All USB peripheral controller drivers call completion routines directly. This patch adds usb_gadget_giveback_request() which will be used instead of direct invocation in the next patch. The goal here is to have a place where common functionality can be added. Signed-off-by: Michal Sojka <sojka@merica.cz> Acked-by: Felipe Balbi <balbi@ti.com> Tested-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/gadget/udc/udc-core.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/usb/gadget/udc/udc-core.c b/drivers/usb/gadget/udc/udc-core.c
index ad1ceac15468..16d3f6fedd1c 100644
--- a/drivers/usb/gadget/udc/udc-core.c
+++ b/drivers/usb/gadget/udc/udc-core.c
@@ -106,6 +106,22 @@ EXPORT_SYMBOL_GPL(usb_gadget_unmap_request);
/* ------------------------------------------------------------------------- */
+/**
+ * usb_gadget_giveback_request - give the request back to the gadget layer
+ * Context: in_interrupt()
+ *
+ * This is called by device controller drivers in order to return the
+ * completed request back to the gadget layer.
+ */
+void usb_gadget_giveback_request(struct usb_ep *ep,
+ struct usb_request *req)
+{
+ req->complete(ep, req);
+}
+EXPORT_SYMBOL_GPL(usb_gadget_giveback_request);
+
+/* ------------------------------------------------------------------------- */
+
static void usb_gadget_state_work(struct work_struct *work)
{
struct usb_gadget *gadget = work_to_gadget(work);