On Sat, Jan 05, 2002, Peter Osterlund <[EMAIL PROTECTED]> wrote: > Johannes Erdfelt <[EMAIL PROTECTED]> writes: > > > On Sat, Jan 05, 2002, Peter Osterlund <[EMAIL PROTECTED]> wrote: > > > Pete Zaitcev <[EMAIL PROTECTED]> writes: > > > > > > #define usb_dec_dev_use usb_free_dev > > > > > > What's the purpose of that define? Just to confuse readers? ;-) > > > > I take blame for it. It was actually to make more sense to readers. > > > > The reason I did that was because having a usb_free_dev call in the HCD > > code wouldn't make logical sense. The HCD isn't freeing the device, it's > > just decrementing the reference count it incremented with > > usb_inc_dev_use. > > > > Just so turns out, the implementation of usb_dec_dev_use and > > usb_free_dev need to be identical because of the reference counting, so > > I just setup a macro. > > Wouldn't it make more sense to rename usb_free_dev to usb_dec_dev_use > and get rid of the macro? usb_free_dev isn't unconditionally freeing > the dev, so I think its name is confusing.
How about this: Split out usb_free_dev into usb_dev_dev_use and usb_free_dev. Have usb_dec_dev_use call usb_free_dev if the count hits zero. Make usb_free_dev static and change all calls to usb_free_dev to usb_dec_dev_use? That should make more sense. JE _______________________________________________ [EMAIL PROTECTED] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel