Commit 89e54e44 authored by Johan Hovold's avatar Johan Hovold Committed by Greg Kroah-Hartman

USB: cdc-acm: remove redundant disconnected test from shutdown

Remove redundant disconnect test from shutdown(), which is never called
post disconnect() where we do synchronous hangup.
Signed-off-by: default avatarJohan Hovold <jhovold@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent bbf0cb3e
...@@ -594,30 +594,27 @@ static void acm_port_shutdown(struct tty_port *port) ...@@ -594,30 +594,27 @@ static void acm_port_shutdown(struct tty_port *port)
dev_dbg(&acm->control->dev, "%s\n", __func__); dev_dbg(&acm->control->dev, "%s\n", __func__);
mutex_lock(&acm->mutex); pm_err = usb_autopm_get_interface(acm->control);
if (!acm->disconnected) { acm_set_control(acm, acm->ctrlout = 0);
pm_err = usb_autopm_get_interface(acm->control);
acm_set_control(acm, acm->ctrlout = 0);
for (;;) {
urb = usb_get_from_anchor(&acm->delayed);
if (!urb)
break;
wb = urb->context;
wb->use = 0;
usb_autopm_put_interface_async(acm->control);
}
usb_kill_urb(acm->ctrlurb); for (;;) {
for (i = 0; i < ACM_NW; i++) urb = usb_get_from_anchor(&acm->delayed);
usb_kill_urb(acm->wb[i].urb); if (!urb)
for (i = 0; i < acm->rx_buflimit; i++) break;
usb_kill_urb(acm->read_urbs[i]); wb = urb->context;
acm->control->needs_remote_wakeup = 0; wb->use = 0;
if (!pm_err) usb_autopm_put_interface_async(acm->control);
usb_autopm_put_interface(acm->control);
} }
mutex_unlock(&acm->mutex);
usb_kill_urb(acm->ctrlurb);
for (i = 0; i < ACM_NW; i++)
usb_kill_urb(acm->wb[i].urb);
for (i = 0; i < acm->rx_buflimit; i++)
usb_kill_urb(acm->read_urbs[i]);
acm->control->needs_remote_wakeup = 0;
if (!pm_err)
usb_autopm_put_interface(acm->control);
} }
static void acm_tty_cleanup(struct tty_struct *tty) static void acm_tty_cleanup(struct tty_struct *tty)
......
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