On Thu, 28 Jun 2007, Marcel Holtmann wrote: > the attached patch is an attempt for usb_alloc_bulk_urb() which will > allocate the URB itself and its transfer buffer. It also use the > endpoint data structure to create the pipe value. Please review it. > > I can create the other helper functions if you think this would be > useful and is heading in the right direction.
In general this looks fine. The awkward pipe constructor is okay because this routine encapsulates it. And with any luck it will go away completely, in time. You should remove the comment about incrementing the reference count. It's confusing since the code doesn't do a get, and anyway people will naturally expect the refcount to start at 1. Oh yes -- you should _add_ a comment line about the URB_FREE_BUFFER flag. Mention that when the driver calls usb_free_urb(), the transfer buffer will automatically be freed at the same time. It's hard to judge how useful it would be without seeing examples of the code that would use it. Presumably you have some real code all set to go. Alan Stern ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel