Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=12f1ff8351e235661beb0314d9ae9417a4871688 Commit: 12f1ff8351e235661beb0314d9ae9417a4871688 Parent: 7fe89e9cc8ebd9da70f760409a4301d26f80a460 Author: Alan Stern <[EMAIL PROTECTED]> AuthorDate: Thu Feb 1 16:08:41 2007 -0500 Committer: Greg Kroah-Hartman <[EMAIL PROTECTED]> CommitDate: Fri Feb 16 15:32:18 2007 -0800
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: Alan Stern <[EMAIL PROTECTED]> Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]> --- drivers/usb/core/hub.c | 25 ++++++++++--------------- 1 files changed, 10 insertions(+), 15 deletions(-) diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index 590ec82..7d60065 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c @@ -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_device *hdev = hub->hdev; unsigned port1; + int status = 0; /* fail if children aren't already suspended */ for (port1 = 1; port1 <= hdev->maxchild; port1++) { @@ -1927,24 +1928,18 @@ static int hub_suspend(struct usb_interface *intf, pm_message_t msg) dev_dbg(&intf->dev, "%s\n", __FUNCTION__); + /* stop khubd and related activity */ + hub_quiesce(hub); + /* "global suspend" of the downstream HC-to-USB interface */ if (!hdev->parent) { - struct usb_bus *bus = hdev->bus; - if (bus) { - int status = hcd_bus_suspend (bus); - - if (status != 0) { - dev_dbg(&hdev->dev, "'global' suspend %d\n", - status); - return status; - } - } else - return -EOPNOTSUPP; + status = hcd_bus_suspend(hdev->bus); + if (status != 0) { + dev_dbg(&hdev->dev, "'global' suspend %d\n", status); + hub_activate(hub); + } } - - /* stop khubd and related activity */ - hub_quiesce(hub); - return 0; + return status; } static int hub_resume(struct usb_interface *intf) - To unsubscribe from this list: send the line "unsubscribe git-commits-head" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html