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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On Mon, Sep 29, 2014 at 10:50:02AM +0200, Robert Baldyga wrote:
> > 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?

complete is mandatory. If a request comes without a complete, it
deserves to oops.

> Maybe it's worth to add this if inside usb_gadget_giveback_request()
> function?

nope, we want those cases to oops so we catch the broken gadget driver.

-- 
balbi

Attachment: signature.asc
Description: Digital signature


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux