aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorOliver Neukum <oliver@neukum.org>2012-01-02 09:11:48 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2012-01-03 19:49:28 -0500
commite78832cdca2ddd23c15abaed642cad1a39b3e122 (patch)
tree44619880735fb8bbd04032192043bddeef7d295b /drivers/usb
parent35284b3d2f68a8a3703745e629999469f78386b5 (diff)
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: Oliver Neukum <oneukum@suse.de> Acked-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/driver.c28
1 files changed, 7 insertions, 21 deletions
diff --git a/drivers/usb/core/driver.c b/drivers/usb/core/driver.c
index 73abd8a0647d..d40ff9568813 100644
--- a/drivers/usb/core/driver.c
+++ b/drivers/usb/core/driver.c
@@ -1079,17 +1079,10 @@ static int usb_suspend_interface(struct usb_device *udev,
1079 goto done; 1079 goto done;
1080 driver = to_usb_driver(intf->dev.driver); 1080 driver = to_usb_driver(intf->dev.driver);
1081 1081
1082 if (driver->suspend) { 1082 /* at this time we know the driver supports suspend */
1083 status = driver->suspend(intf, msg); 1083 status = driver->suspend(intf, msg);
1084 if (status && !PMSG_IS_AUTO(msg)) 1084 if (status && !PMSG_IS_AUTO(msg))
1085 dev_err(&intf->dev, "%s error %d\n", 1085 dev_err(&intf->dev, "suspend error %d\n", status);
1086 "suspend", status);
1087 } else {
1088 /* Later we will unbind the driver and reprobe */
1089 intf->needs_binding = 1;
1090 dev_warn(&intf->dev, "no %s for driver %s?\n",
1091 "suspend", driver->name);
1092 }
1093 1086
1094 done: 1087 done:
1095 dev_vdbg(&intf->dev, "%s: status %d\n", __func__, status); 1088 dev_vdbg(&intf->dev, "%s: status %d\n", __func__, status);
@@ -1138,16 +1131,9 @@ static int usb_resume_interface(struct usb_device *udev,
1138 "reset_resume", driver->name); 1131 "reset_resume", driver->name);
1139 } 1132 }
1140 } else { 1133 } else {
1141 if (driver->resume) { 1134 status = driver->resume(intf);
1142 status = driver->resume(intf); 1135 if (status)
1143 if (status) 1136 dev_err(&intf->dev, "resume error %d\n", status);
1144 dev_err(&intf->dev, "%s error %d\n",
1145 "resume", status);
1146 } else {
1147 intf->needs_binding = 1;
1148 dev_warn(&intf->dev, "no %s for driver %s?\n",
1149 "resume", driver->name);
1150 }
1151 } 1137 }
1152 1138
1153done: 1139done: