Commit e78832cd authored by Oliver Neukum's avatar Oliver Neukum Committed by Greg Kroah-Hartman

USB: remove dead code from suspend/resume path

If a driver does not support the suspend/resume callbacks
it will be forcibly disconnected. There is no reason to check
for support of the callbacks after that.
Signed-off-by: default avatarOliver Neukum <oneukum@suse.de>
Acked-by: default avatarAlan Stern <stern@rowland.harvard.edu>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 35284b3d
...@@ -1079,17 +1079,10 @@ static int usb_suspend_interface(struct usb_device *udev, ...@@ -1079,17 +1079,10 @@ static int usb_suspend_interface(struct usb_device *udev,
goto done; goto done;
driver = to_usb_driver(intf->dev.driver); driver = to_usb_driver(intf->dev.driver);
if (driver->suspend) { /* at this time we know the driver supports suspend */
status = driver->suspend(intf, msg); status = driver->suspend(intf, msg);
if (status && !PMSG_IS_AUTO(msg)) if (status && !PMSG_IS_AUTO(msg))
dev_err(&intf->dev, "%s error %d\n", dev_err(&intf->dev, "suspend error %d\n", status);
"suspend", status);
} else {
/* Later we will unbind the driver and reprobe */
intf->needs_binding = 1;
dev_warn(&intf->dev, "no %s for driver %s?\n",
"suspend", driver->name);
}
done: done:
dev_vdbg(&intf->dev, "%s: status %d\n", __func__, status); dev_vdbg(&intf->dev, "%s: status %d\n", __func__, status);
...@@ -1138,16 +1131,9 @@ static int usb_resume_interface(struct usb_device *udev, ...@@ -1138,16 +1131,9 @@ static int usb_resume_interface(struct usb_device *udev,
"reset_resume", driver->name); "reset_resume", driver->name);
} }
} else { } else {
if (driver->resume) {
status = driver->resume(intf); status = driver->resume(intf);
if (status) if (status)
dev_err(&intf->dev, "%s error %d\n", dev_err(&intf->dev, "resume error %d\n", status);
"resume", status);
} else {
intf->needs_binding = 1;
dev_warn(&intf->dev, "no %s for driver %s?\n",
"resume", driver->name);
}
} }
done: done:
......
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