aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2008-06-10 14:59:43 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2008-07-21 18:15:48 -0400
commit9e5eace734a7b4e96a4ba4cf1f85622446e95e17 (patch)
treee53a657ce7dda2dca72ad4157331f61cba3e0ab5 /drivers
parent24618b0cd42f936cda461bdf6144670a5c925178 (diff)
USB: revert "don't use reset-resume if drivers don't support it"
This reverts Linus's previous patch that is in mainline to make it easier for the USB hub.c patches that follow this to apply cleanly. The functionality will be added back in a followon patch in this series. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/usb/core/hub.c46
1 files changed, 2 insertions, 44 deletions
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index d741b9457427..976da1c4919b 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -644,48 +644,6 @@ static void hub_stop(struct usb_hub *hub)
644 644
645#ifdef CONFIG_PM 645#ifdef CONFIG_PM
646 646
647/* Try to identify which devices need USB-PERSIST handling */
648static int persistent_device(struct usb_device *udev)
649{
650 int i;
651 int retval;
652 struct usb_host_config *actconfig;
653
654 /* Explicitly not marked persistent? */
655 if (!udev->persist_enabled)
656 return 0;
657
658 /* No active config? */
659 actconfig = udev->actconfig;
660 if (!actconfig)
661 return 0;
662
663 /* FIXME! We should check whether it's open here or not! */
664
665 /*
666 * Check that all the interface drivers have a
667 * 'reset_resume' entrypoint
668 */
669 retval = 0;
670 for (i = 0; i < actconfig->desc.bNumInterfaces; i++) {
671 struct usb_interface *intf;
672 struct usb_driver *driver;
673
674 intf = actconfig->interface[i];
675 if (!intf->dev.driver)
676 continue;
677 driver = to_usb_driver(intf->dev.driver);
678 if (!driver->reset_resume)
679 return 0;
680 /*
681 * We have at least one driver, and that one
682 * has a reset_resume method.
683 */
684 retval = 1;
685 }
686 return retval;
687}
688
689static void hub_restart(struct usb_hub *hub, int type) 647static void hub_restart(struct usb_hub *hub, int type)
690{ 648{
691 struct usb_device *hdev = hub->hdev; 649 struct usb_device *hdev = hub->hdev;
@@ -731,8 +689,8 @@ static void hub_restart(struct usb_hub *hub, int type)
731 * turn off the various status changes to prevent 689 * turn off the various status changes to prevent
732 * khubd from disconnecting it later. 690 * khubd from disconnecting it later.
733 */ 691 */
734 if (status == 0 && !(portstatus & USB_PORT_STAT_ENABLE) && 692 if (udev->persist_enabled && status == 0 &&
735 persistent_device(udev)) { 693 !(portstatus & USB_PORT_STAT_ENABLE)) {
736 if (portchange & USB_PORT_STAT_C_ENABLE) 694 if (portchange & USB_PORT_STAT_C_ENABLE)
737 clear_port_feature(hub->hdev, port1, 695 clear_port_feature(hub->hdev, port1,
738 USB_PORT_FEAT_C_ENABLE); 696 USB_PORT_FEAT_C_ENABLE);