Re: [PATCH v4 12/23] usb: gadget: ether: allocate and init otg descriptor by otg capabilities

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

 




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 devicetree" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]
  Powered by Linux