diff options
author | Alan Stern <stern@rowland.harvard.edu> | 2008-08-12 14:33:27 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2008-08-21 13:26:36 -0400 |
commit | 65605ae8e587d714f73e674369bc4cd5a1e53a9b (patch) | |
tree | 823a14c8870352de6a9a99a82297ba794172143c /drivers/usb/core | |
parent | 74573ee7096a4ffc2f098108d21c85801b9c7434 (diff) |
USB: Add udev argument to interface suspend/resume functions
This patch (as1127) makes a minor change to the prototypes of the
usb_suspend_interface() and usb_resume_interface() routines. Now the
usb_device structure is passed as an argument, instead of being
computed on-the-fly from the usb_interface argument.
It makes the code look simpler, even if it really isn't much different
from before.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/core')
-rw-r--r-- | drivers/usb/core/driver.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/usb/core/driver.c b/drivers/usb/core/driver.c index 2be37fe466f2..ed1cc8530a93 100644 --- a/drivers/usb/core/driver.c +++ b/drivers/usb/core/driver.c | |||
@@ -926,14 +926,14 @@ static int usb_resume_device(struct usb_device *udev) | |||
926 | } | 926 | } |
927 | 927 | ||
928 | /* Caller has locked intf's usb_device's pm mutex */ | 928 | /* Caller has locked intf's usb_device's pm mutex */ |
929 | static int usb_suspend_interface(struct usb_interface *intf, pm_message_t msg) | 929 | static int usb_suspend_interface(struct usb_device *udev, |
930 | struct usb_interface *intf, pm_message_t msg) | ||
930 | { | 931 | { |
931 | struct usb_driver *driver; | 932 | struct usb_driver *driver; |
932 | int status = 0; | 933 | int status = 0; |
933 | 934 | ||
934 | /* with no hardware, USB interfaces only use FREEZE and ON states */ | 935 | /* with no hardware, USB interfaces only use FREEZE and ON states */ |
935 | if (interface_to_usbdev(intf)->state == USB_STATE_NOTATTACHED || | 936 | if (udev->state == USB_STATE_NOTATTACHED || !is_active(intf)) |
936 | !is_active(intf)) | ||
937 | goto done; | 937 | goto done; |
938 | 938 | ||
939 | if (intf->condition == USB_INTERFACE_UNBOUND) /* This can't happen */ | 939 | if (intf->condition == USB_INTERFACE_UNBOUND) /* This can't happen */ |
@@ -944,7 +944,7 @@ static int usb_suspend_interface(struct usb_interface *intf, pm_message_t msg) | |||
944 | status = driver->suspend(intf, msg); | 944 | status = driver->suspend(intf, msg); |
945 | if (status == 0) | 945 | if (status == 0) |
946 | mark_quiesced(intf); | 946 | mark_quiesced(intf); |
947 | else if (!interface_to_usbdev(intf)->auto_pm) | 947 | else if (!udev->auto_pm) |
948 | dev_err(&intf->dev, "%s error %d\n", | 948 | dev_err(&intf->dev, "%s error %d\n", |
949 | "suspend", status); | 949 | "suspend", status); |
950 | } else { | 950 | } else { |
@@ -961,13 +961,13 @@ static int usb_suspend_interface(struct usb_interface *intf, pm_message_t msg) | |||
961 | } | 961 | } |
962 | 962 | ||
963 | /* Caller has locked intf's usb_device's pm_mutex */ | 963 | /* Caller has locked intf's usb_device's pm_mutex */ |
964 | static int usb_resume_interface(struct usb_interface *intf, int reset_resume) | 964 | static int usb_resume_interface(struct usb_device *udev, |
965 | struct usb_interface *intf, int reset_resume) | ||
965 | { | 966 | { |
966 | struct usb_driver *driver; | 967 | struct usb_driver *driver; |
967 | int status = 0; | 968 | int status = 0; |
968 | 969 | ||
969 | if (interface_to_usbdev(intf)->state == USB_STATE_NOTATTACHED || | 970 | if (udev->state == USB_STATE_NOTATTACHED || is_active(intf)) |
970 | is_active(intf)) | ||
971 | goto done; | 971 | goto done; |
972 | 972 | ||
973 | /* Don't let autoresume interfere with unbinding */ | 973 | /* Don't let autoresume interfere with unbinding */ |
@@ -1151,7 +1151,7 @@ static int usb_suspend_both(struct usb_device *udev, pm_message_t msg) | |||
1151 | if (udev->actconfig) { | 1151 | if (udev->actconfig) { |
1152 | for (; i < udev->actconfig->desc.bNumInterfaces; i++) { | 1152 | for (; i < udev->actconfig->desc.bNumInterfaces; i++) { |
1153 | intf = udev->actconfig->interface[i]; | 1153 | intf = udev->actconfig->interface[i]; |
1154 | status = usb_suspend_interface(intf, msg); | 1154 | status = usb_suspend_interface(udev, intf, msg); |
1155 | if (status != 0) | 1155 | if (status != 0) |
1156 | break; | 1156 | break; |
1157 | } | 1157 | } |
@@ -1163,7 +1163,7 @@ static int usb_suspend_both(struct usb_device *udev, pm_message_t msg) | |||
1163 | if (status != 0) { | 1163 | if (status != 0) { |
1164 | while (--i >= 0) { | 1164 | while (--i >= 0) { |
1165 | intf = udev->actconfig->interface[i]; | 1165 | intf = udev->actconfig->interface[i]; |
1166 | usb_resume_interface(intf, 0); | 1166 | usb_resume_interface(udev, intf, 0); |
1167 | } | 1167 | } |
1168 | 1168 | ||
1169 | /* Try another autosuspend when the interfaces aren't busy */ | 1169 | /* Try another autosuspend when the interfaces aren't busy */ |
@@ -1276,7 +1276,7 @@ static int usb_resume_both(struct usb_device *udev) | |||
1276 | if (status == 0 && udev->actconfig) { | 1276 | if (status == 0 && udev->actconfig) { |
1277 | for (i = 0; i < udev->actconfig->desc.bNumInterfaces; i++) { | 1277 | for (i = 0; i < udev->actconfig->desc.bNumInterfaces; i++) { |
1278 | intf = udev->actconfig->interface[i]; | 1278 | intf = udev->actconfig->interface[i]; |
1279 | usb_resume_interface(intf, udev->reset_resume); | 1279 | usb_resume_interface(udev, intf, udev->reset_resume); |
1280 | } | 1280 | } |
1281 | } | 1281 | } |
1282 | 1282 | ||