Hi, On Fri, Jan 14, 2011 at 04:14:12PM +0200, Felipe Balbi wrote: > > Why not embed the gadget and the device node directly in the usb_udc > > structure, instead of just putting pointers there? > > I'll do that now. Thanks. I had an idea of completely re-writting this. It really doesn't to be this complicated. I was thinking of something more like: struct udc { struct usb_gadget *gadget; struct usb_gadget_driver *driver; struct list_head list; }; then add a function like: int usb_add_gadget(struct device *parent, struct usb_gadget *gadget, struct usb_gadget_ops *ops) { struct usb_udc *udc; udc = kzalloc(sizeof(*udc), GFP_KERNEL); if (!udc) return -ENOMEM; gadget->dev.parent = parent; gadget->ops = ops; udc->gadget = gadget; INIT_LIST_HEAD(&udc->list); list_add_tail(&udc->list, &udc_list); return device_register(&gadget->dev); } a lot simpler, it won't have too many changes needed on gadget controllers and it will still allow to compile several of them together. Of course I'll do this on top of Michal's recent patch. -- balbi -- 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