Interesting... so, you're saying that a driver that only uses the structure
between probe() and disconnect() does not need usb_get/put_dev()?

So why did someone add those calls to usb-storage?

Matt

On Sun, Feb 23, 2003 at 03:03:13PM -0500, Johannes Erdfelt wrote:
> On Sun, Feb 23, 2003, Duncan Sands <[EMAIL PROTECTED]> wrote:
> > The comment for usb_get_dev says:
> > 
> > /**
> >  * 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.
> >  */
> > 
> > Why should drivers use usb_get_dev in probe, and usb_put_dev in disconnect?
> 
> No reason. A reference is already done by the core which covers the
> reference for that whole period of time.
> 
> If you want to use the device structure longer than that, you need to
> keep a reference yourself.
> 
> It seems like another misunderstading.
> 
> JE
> 
> 
> 
> -------------------------------------------------------
> This SF.net email is sponsored by: SlickEdit Inc. Develop an edge.
> The most comprehensive and flexible code editor you can use.
> Code faster. C/C++, C#, Java, HTML, XML, many more. FREE 30-Day Trial.
> www.slickedit.com/sourceforge
> _______________________________________________
> [EMAIL PROTECTED]
> To unsubscribe, use the last form field at:
> https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

-- 
Matthew Dharm                              Home: [EMAIL PROTECTED] 
Maintainer, Linux USB Mass Storage Driver

It was a new hope.
                                        -- Dust Puppy
User Friendly, 12/25/1998

Attachment: pgp00000.pgp
Description: PGP signature

Reply via email to