USB: improve uses of usb_mark_last_busy
authorAlan Stern <stern@rowland.harvard.edu>
Mon, 15 Nov 2010 20:57:58 +0000 (15:57 -0500)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 16 Nov 2010 22:04:22 +0000 (14:04 -0800)
commitc08512c761e7b9eaaab0e9167a389393f268e93c
tree6837bfb8e93915dae46a63a863275f90428f82f0
parentfcc4a01eb8661226e80632327673f67bf6a5840b
USB: improve uses of usb_mark_last_busy

This patch (as1434) cleans up the uses of usb_mark_last_busy() in
usbcore.  The function will be called when a device is resumed and
whenever a usage count is decremented.  A call that was missing from
the hub driver is added: A hub is used whenever one of its ports gets
suspended (this prevents hubs from suspending immediately after their
last child).

In addition, the call to disable autosuspend support for new devices
by default is moved from usb_detect_quirks() (where it doesn't really
belong) into usb_new_device() along with all the other runtime-PM
initializations.  Finally, an extra pm_runtime_get_noresume() is added
to prevent new devices from autosuspending while they are being
registered.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/core/driver.c
drivers/usb/core/hub.c
drivers/usb/core/quirks.c