lkml.org 
[lkml]   [2014]   [Aug]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3 1/2] usb: gadget: Refactor request completion
On Wed, 27 Aug 2014, Michal Sojka wrote:

> All USB peripheral controller drivers called completion routines
> directly. This patch moves the completion call from drivers to
> usb_gadget_giveback_request(), in order to have a place where common
> functionality can be added.
>
> All places in drivers/usb/ matching "[-.]complete(" were replaced with a
> call to usb_gadget_giveback_request(). This was compile-tested with all
> ARM drivers enabled and runtime-tested for musb.


> --- a/drivers/usb/gadget/udc/udc-core.c
> +++ b/drivers/usb/gadget/udc/udc-core.c
> @@ -102,6 +102,15 @@ void usb_gadget_unmap_request(struct usb_gadget *gadget,
> }
> EXPORT_SYMBOL_GPL(usb_gadget_unmap_request);
>
> +void usb_gadget_giveback_request(struct usb_ep *ep,
> + struct usb_request *req)
> +{
> + /* complete() is from gadget layer,
> + * eg fsg->bulk_in_complete() */

Wrong format for a multi-line comment. It should look like this:

/*
* Blah, blah, blah
* blah, blah, blah
*/

Also, the reference to fsg is obsolete; the File-backed Storage Gadget
is no longer in the kernel. You might as well leave the comment out
entirely.

> + if (req->complete)

This test shouldn't be here. The UDC drivers don't do it, but they
probably do check the req->complete isn't NULL when the request is
submitted. In any case, if req->complete is NULL then we want to know
about it because it is a bug. It should not be covered up silently.

> + req->complete(ep, req);
> +}
> +EXPORT_SYMBOL_GPL(usb_gadget_giveback_request);
> #endif /* CONFIG_HAS_DMA */

Alan Stern



\
 
 \ /
  Last update: 2014-08-27 17:21    [W:0.176 / U:0.360 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site