提交 81e5b23c 编写于 作者: O Oliver Neukum 提交者: Greg Kroah-Hartman

USB: fix wrong order of events in usb serial suspension

if a subdriver has an additional suspend method, it must be called
first to allow the subdriver to return -EBUSY, because the second
half cannot be easily undone.
Signed-off-by: NOliver Neukum <oliver@neukum.org>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 807fcb5e
......@@ -1157,15 +1157,19 @@ int usb_serial_suspend(struct usb_interface *intf, pm_message_t message)
serial->suspending = 1;
if (serial->type->suspend) {
r = serial->type->suspend(serial, message);
if (r < 0)
goto err_out;
}
for (i = 0; i < serial->num_ports; ++i) {
port = serial->port[i];
if (port)
kill_traffic(port);
}
if (serial->type->suspend)
r = serial->type->suspend(serial, message);
err_out:
return r;
}
EXPORT_SYMBOL(usb_serial_suspend);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册