On Mon, Apr 08, 2002 at 01:18:47PM -0700, David Brownell wrote:
> Hi,
> 
> This patch is a more complete fix for the device refcount
> sanity checking and cleanup on device disconnect.
> 
>     - Splits apart usb_dec_dev_use(), for driver use, and
>       usb_free_dev(), for hub/hcd use.  Both now have
>       kerneldoc, and will BUG() if the refcount and the
>       device tree get out of sync.  (Except for cleanup of
>       root hub init errors, refcount must go to zero only
>       at the instant disconnect processing completes.)

I know this is the way things currently work, and like the patch...
But why have a special case for hub/hcd use that is different from the
drivers?  If a driver wants to grab a device, it should be able to use
it until it decrements the count.  Now granted that usage could just
spit back errors from the hcd, as the device is no longer present, but
it would still be valid.

Then there would be no special cases, and the memory would be present
for whoever is using the device.  Much like the current usb_free_urb()
and usb_alloc_urb() code works.

I can try to get this to work if you don't want to do it, as it's one of
the things I think will clean up the usb driver model a lot, and have
been wanting for a while.

>     - More usbcore-internal function declarations are
>       now moved out of <linux/usb.h> into hcd.h 

Nice, I like this.

thanks,

greg k-h

_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Sponsored by http://www.ThinkGeek.com/

Reply via email to