Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 36380
b: refs/heads/master
c: 1c5df7e
h: refs/heads/master
v: v3
  • Loading branch information
Alan Stern authored and Greg Kroah-Hartman committed Sep 27, 2006
1 parent 87ae1e6 commit 54410b3
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 114b368c07964caa3f4e1fa575b16e87fa11936c
refs/heads/master: 1c5df7e705671f11a71112eb3a1f9765cd1719f9
19 changes: 15 additions & 4 deletions trunk/drivers/usb/core/driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -761,8 +761,12 @@ static int suspend_device(struct usb_device *udev, pm_message_t msg)
udev->state == USB_STATE_SUSPENDED)
goto done;

if (udev->dev.driver == NULL)
/* For devices that don't have a driver, we do a standard suspend. */
if (udev->dev.driver == NULL) {
status = usb_port_suspend(udev);
goto done;
}

udriver = to_usb_device_driver(udev->dev.driver);
status = udriver->suspend(udev, msg);

Expand All @@ -782,8 +786,12 @@ static int resume_device(struct usb_device *udev)
udev->state != USB_STATE_SUSPENDED)
goto done;

if (udev->dev.driver == NULL)
/* Can't resume it if it doesn't have a driver. */
if (udev->dev.driver == NULL) {
status = -ENOTCONN;
goto done;
}

udriver = to_usb_device_driver(udev->dev.driver);
status = udriver->resume(udev);

Expand All @@ -804,7 +812,7 @@ static int suspend_interface(struct usb_interface *intf, pm_message_t msg)
!is_active(intf))
goto done;

if (intf->dev.driver == NULL)
if (intf->dev.driver == NULL) /* This can't happen */
goto done;
driver = to_usb_driver(intf->dev.driver);

Expand Down Expand Up @@ -838,8 +846,11 @@ static int resume_interface(struct usb_interface *intf)
is_active(intf))
goto done;

if (intf->dev.driver == NULL)
/* Can't resume it if it doesn't have a driver. */
if (intf->dev.driver == NULL) {
status = -ENOTCONN;
goto done;
}
driver = to_usb_driver(intf->dev.driver);

if (driver->resume) {
Expand Down

0 comments on commit 54410b3

Please sign in to comment.