Re: [PATCH 3/3] langwell_udc: don't call gadget's disconnect()

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

 



On Tue, 20 Dec 2011 18:44:17 +0200, Felipe Balbi <balbi@xxxxxx> wrote:
> Hi,

Hi,

> On Tue, Dec 20, 2011 at 05:57:09PM +0200, Alexander Shishkin wrote:
> > UDC core will call disconnect() and unbind() for us upon the gadget
> > removal, so we should not do it ourselves. Otherwise, a composite
> > gadget will explode, for example. Others might too.
> > 
> > Signed-off-by: Alexander Shishkin <alexander.shishkin@xxxxxxxxxxxxxxx>
> > Cc: Heikki Krogerus <heikki.krogerus@xxxxxxxxxxxxxxx>
> > Cc: Greg Kroah-Hartman <gregkh@xxxxxxx>
> > Cc: linux-usb@xxxxxxxxxxxxxxx
> > ---
> >  drivers/usb/gadget/langwell_udc.c |    2 +-
> >  1 files changed, 1 insertions(+), 1 deletions(-)
> > 
> > diff --git a/drivers/usb/gadget/langwell_udc.c b/drivers/usb/gadget/langwell_udc.c
> > index 34e3bf8..580548b 100644
> > --- a/drivers/usb/gadget/langwell_udc.c
> > +++ b/drivers/usb/gadget/langwell_udc.c
> > @@ -1920,7 +1920,7 @@ static int langwell_stop(struct usb_gadget *g,
> >  
> >  	/* stop all usb activities */
> >  	dev->gadget.speed = USB_SPEED_UNKNOWN;
> > -	stop_activity(dev, driver);
> > +	stop_activity(dev, NULL);
> 
> this is quite a hack :-) The real fix will be remove the dead code and
> the extra (now useless) 'driver' parameter to stop_activity. You can

It's not really dead code, you still need to call disconnect in bus
reset path, for example. You're right about the useless parameter,
though.

> also blame me for the bad conversion to udc_start/udc_stop. The commit
> which introduced the bug was 2c7f0989

Regards,
--
Alex
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


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

  Powered by Linux