diff options
author | Alan Stern <stern@rowland.harvard.edu> | 2007-02-01 16:08:41 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2007-02-16 18:32:18 -0500 |
commit | 12f1ff8351e235661beb0314d9ae9417a4871688 (patch) | |
tree | a271549c8f9532fca46672b5b38c5dd95f2c41ea /drivers/usb | |
parent | 7fe89e9cc8ebd9da70f760409a4301d26f80a460 (diff) |
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 <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | 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 590ec82d0515..7d6006573543 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) | |||
1904 | struct usb_hub *hub = usb_get_intfdata (intf); | 1904 | struct usb_hub *hub = usb_get_intfdata (intf); |
1905 | struct usb_device *hdev = hub->hdev; | 1905 | struct usb_device *hdev = hub->hdev; |
1906 | unsigned port1; | 1906 | unsigned port1; |
1907 | int status = 0; | ||
1907 | 1908 | ||
1908 | /* fail if children aren't already suspended */ | 1909 | /* fail if children aren't already suspended */ |
1909 | for (port1 = 1; port1 <= hdev->maxchild; port1++) { | 1910 | for (port1 = 1; port1 <= hdev->maxchild; port1++) { |
@@ -1927,24 +1928,18 @@ static int hub_suspend(struct usb_interface *intf, pm_message_t msg) | |||
1927 | 1928 | ||
1928 | dev_dbg(&intf->dev, "%s\n", __FUNCTION__); | 1929 | dev_dbg(&intf->dev, "%s\n", __FUNCTION__); |
1929 | 1930 | ||
1931 | /* stop khubd and related activity */ | ||
1932 | hub_quiesce(hub); | ||
1933 | |||
1930 | /* "global suspend" of the downstream HC-to-USB interface */ | 1934 | /* "global suspend" of the downstream HC-to-USB interface */ |
1931 | if (!hdev->parent) { | 1935 | if (!hdev->parent) { |
1932 | struct usb_bus *bus = hdev->bus; | 1936 | status = hcd_bus_suspend(hdev->bus); |
1933 | if (bus) { | 1937 | if (status != 0) { |
1934 | int status = hcd_bus_suspend (bus); | 1938 | dev_dbg(&hdev->dev, "'global' suspend %d\n", status); |
1935 | 1939 | hub_activate(hub); | |
1936 | if (status != 0) { | 1940 | } |
1937 | dev_dbg(&hdev->dev, "'global' suspend %d\n", | ||
1938 | status); | ||
1939 | return status; | ||
1940 | } | ||
1941 | } else | ||
1942 | return -EOPNOTSUPP; | ||
1943 | } | 1941 | } |
1944 | 1942 | return status; | |
1945 | /* stop khubd and related activity */ | ||
1946 | hub_quiesce(hub); | ||
1947 | return 0; | ||
1948 | } | 1943 | } |
1949 | 1944 | ||
1950 | static int hub_resume(struct usb_interface *intf) | 1945 | static int hub_resume(struct usb_interface *intf) |