• David Brownell's avatar
    This patch is a more complete fix for the device refcount · 99e471c7
    David Brownell authored
    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.)
      
        - More usbcore-internal function declarations are
          now moved out of <linux/usb.h> into hcd.h
      
        - Driver-accessible refcounting is now inlined; minor
          code shrinkage, it's using atomic inc/dec instructions
          not function calls.
    
    <note from greg k-h, there is still some work to be done with USB device
     reference counting, but this patch is a step in the right direction.>
    99e471c7
usb.c 79.4 KB