On Tue, Feb 25, 2003, Duncan Sands <[EMAIL PROTECTED]> wrote:
> On Monday 24 February 2003 21:11, Johannes Erdfelt wrote:
> > On Mon, Feb 24, 2003, Duncan Sands <[EMAIL PROTECTED]> wrote:
> > > --- bollux-2.5/drivers/usb/core/usb.c.orig        2003-02-24 13:52:49.000000000
> > > +0100 +++ bollux-2.5/drivers/usb/core/usb.c       2003-02-24 13:56:20.000000000
> > > +0100 @@ -701,12 +701,6 @@
> > >   * usb_get_dev - increments the reference count of the usb device
> > > structure * @dev: the device being referenced
> > >   *
> > > - * Each live reference to a device should be refcounted.
> > > - *
> > > - * Drivers for USB interfaces should normally record such references in
> > > - * their probe() methods, when they bind to an interface, and release
> > > - * them by calling usb_put_dev(), in their disconnect() methods.
> > > - *
> > >   * A pointer to the device with the incremented reference counter is
> > > returned. */
> > >  struct usb_device *usb_get_dev (struct usb_device *dev)
> >
> > Actually, the first line ("Each live reference...") is accurate and
> > should probably stay.
> 
> I thought it would just be confusing to device driver writers.  It seems to me
> that this comment is really aimed at people working on the USB core and
> they know that anyway.  Also, I'm willing to bet that all driver writers know
> (even if they didn't think about it) that they get a reference on their behalf in
> probe, and lose it in disconnect.  After all, every driver they look at acts that
> way, and of course it has to be that way.

It may be confusing to leave just that comment there.

However, like Dave mentioned in another reply, an explanation that a
reference is implicit between probe() and disconnect() should make
everything clear enough.

JE



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to