On Wed, Jun 17, 2015 at 12:03:04PM +0300, Roger Quadros wrote:
> 
> >  
> >     if (gadget_is_otg(c->cdev->gadget)) {
> > +           if (!otg_desc[0]) {
> > +                   struct usb_descriptor_header *usb_desc;
> > +
> > +                   usb_desc = usb_otg_descriptor_alloc(c->cdev->gadget);
> > +                   if (!usb_desc)
> > +                           return -ENOMEM;
> > +                   usb_otg_descriptor_init(c->cdev->gadget, usb_desc);
> > +                   otg_desc[0] = usb_desc;
> > +                   otg_desc[1] = NULL;
> > +           }
> 
> Why can't you do the otg_desc alloc/init in eth_bind()?
> That way you don't have to have this code twice
> in rndis_do_config() and eth_do_config().
> 
> It also matches the free being done in eth_unbind().
> >  

Okay, I will update for all legacy gadget drivers.

Li Jun
> 
> cheers,
> -roger
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to