]> git.baikalelectronics.ru Git - kernel.git/commit
usbcore: fix up device and power state tests
authorAlan Stern <stern@rowland.harvard.edu>
Sun, 2 Jul 2006 02:13:04 +0000 (22:13 -0400)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 27 Sep 2006 18:58:50 +0000 (11:58 -0700)
commit40e14e693cf51ffa06e324951763a6dca972514e
tree74500e47040be3bf4923eebd60404fc7b62004a9
parentf5c6e51c882adfa17cd1afb7d0e8bde54dfef8b0
usbcore: fix up device and power state tests

This patch (as734) rationalizes the various tests of device state and
power states.  There are duplications and mistaken tests in several
places.

Perhaps the most interesting challenge is where the hub driver tests to
see that all the child devices are suspended before allowing itself to
be suspended.  When CONFIG_USB_SUSPEND is set the test is
straightforward, since we expect that the children _will_ be suspended.
But when CONFIG_USB_SUSPEND isn't set, it's not so clear what should be
done.  The code compromises by checking the child's
power.power_state.event field.

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/generic.c
drivers/usb/core/hub.c