Commit 12f1ff83 authored by Alan Stern's avatar Alan Stern Committed by Greg Kroah-Hartman

usbcore: small changes to hub driver's suspend method

This patch (as847) makes some small changes to the hub driver's
suspend method:

	For root hubs, the status URB should be unlinked and other
	activity stopped _before_ the bus_suspend method is called.

	The test for hdev->bus being NULL has been removed, since
	it can never succeed.
Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 7fe89e9c
...@@ -1904,6 +1904,7 @@ static int hub_suspend(struct usb_interface *intf, pm_message_t msg) ...@@ -1904,6 +1904,7 @@ static int hub_suspend(struct usb_interface *intf, pm_message_t msg)
struct usb_hub *hub = usb_get_intfdata (intf); struct usb_hub *hub = usb_get_intfdata (intf);
struct usb_device *hdev = hub->hdev; struct usb_device *hdev = hub->hdev;
unsigned port1; unsigned port1;
int status = 0;
/* fail if children aren't already suspended */ /* fail if children aren't already suspended */
for (port1 = 1; port1 <= hdev->maxchild; port1++) { for (port1 = 1; port1 <= hdev->maxchild; port1++) {
...@@ -1927,24 +1928,18 @@ static int hub_suspend(struct usb_interface *intf, pm_message_t msg) ...@@ -1927,24 +1928,18 @@ static int hub_suspend(struct usb_interface *intf, pm_message_t msg)
dev_dbg(&intf->dev, "%s\n", __FUNCTION__); dev_dbg(&intf->dev, "%s\n", __FUNCTION__);
/* stop khubd and related activity */
hub_quiesce(hub);
/* "global suspend" of the downstream HC-to-USB interface */ /* "global suspend" of the downstream HC-to-USB interface */
if (!hdev->parent) { if (!hdev->parent) {
struct usb_bus *bus = hdev->bus; status = hcd_bus_suspend(hdev->bus);
if (bus) { if (status != 0) {
int status = hcd_bus_suspend (bus); dev_dbg(&hdev->dev, "'global' suspend %d\n", status);
hub_activate(hub);
if (status != 0) { }
dev_dbg(&hdev->dev, "'global' suspend %d\n",
status);
return status;
}
} else
return -EOPNOTSUPP;
} }
return status;
/* stop khubd and related activity */
hub_quiesce(hub);
return 0;
} }
static int hub_resume(struct usb_interface *intf) static int hub_resume(struct usb_interface *intf)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment