Re: [PATCH v6 2/4] usb: gadget: Refactor request completion

From: Michal Sojka
Date: Mon Sep 29 2014 - 05:13:46 EST


On Mon, Sep 29 2014, Robert Baldyga wrote:
> Hi,
>
> On 09/24/2014 10:43 PM, Michal Sojka wrote:
>> Use the recently introduced usb_gadget_giveback_request() in favor of
>> direct invocation of the completion routine.
>>
>> 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.
>>
>> Signed-off-by: Michal Sojka <sojka@xxxxxxxxx>

[...]

>> diff --git a/drivers/usb/gadget/udc/fsl_qe_udc.c b/drivers/usb/gadget/udc/fsl_qe_udc.c
>> index 7324308..dd18ea3 100644
>> --- a/drivers/usb/gadget/udc/fsl_qe_udc.c
>> +++ b/drivers/usb/gadget/udc/fsl_qe_udc.c
>> @@ -118,10 +118,7 @@ static void done(struct qe_ep *ep, struct qe_req *req, int status)
>> ep->stopped = 1;
>> spin_unlock(&udc->lock);
>>
>> - /* this complete() should a func implemented by gadget layer,
>> - * eg fsg->bulk_in_complete() */
>> - if (req->req.complete)
>> - req->req.complete(&ep->ep, &req->req);
>> + usb_gadget_giveback_request(&ep->ep, &req->req);
>
> It looks like you have omitted if() statement. Are you sure that request
> has set complete() callback?

Yes, see the rest of the thread. This was suggested by other reviewers.

-Michal
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/