Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9c210bfa authored by Johan Hovold's avatar Johan Hovold Committed by Greg Kroah-Hartman
Browse files

USB: sierra: remove bogus disconnect test in close



Remove bogus (and unnecessary) test for serial->dev being NULL in close.

The device is never cleared, and close is never called after a completed
disconnect anyway.

Signed-off-by: default avatarJohan Hovold <jhovold@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent bb3529c6
Loading
Loading
Loading
Loading
+17 −22
Original line number Original line Diff line number Diff line
@@ -778,7 +778,6 @@ static void sierra_close(struct usb_serial_port *port)
	portdata->rts_state = 0;
	portdata->rts_state = 0;
	portdata->dtr_state = 0;
	portdata->dtr_state = 0;


	if (serial->dev) {
	mutex_lock(&serial->disc_mutex);
	mutex_lock(&serial->disc_mutex);
	if (!serial->disconnected) {
	if (!serial->disconnected) {
		serial->interface->needs_remote_wakeup = 0;
		serial->interface->needs_remote_wakeup = 0;
@@ -794,16 +793,12 @@ static void sierra_close(struct usb_serial_port *port)
	portdata->opened = 0;
	portdata->opened = 0;
	spin_unlock_irq(&intfdata->susp_lock);
	spin_unlock_irq(&intfdata->susp_lock);



		/* Stop reading urbs */
	sierra_stop_rx_urbs(port);
	sierra_stop_rx_urbs(port);
		/* .. and release them */
	for (i = 0; i < portdata->num_in_urbs; i++) {
	for (i = 0; i < portdata->num_in_urbs; i++) {
		sierra_release_urb(portdata->in_urbs[i]);
		sierra_release_urb(portdata->in_urbs[i]);
		portdata->in_urbs[i] = NULL;
		portdata->in_urbs[i] = NULL;
	}
	}
}
}
}


static int sierra_open(struct tty_struct *tty, struct usb_serial_port *port)
static int sierra_open(struct tty_struct *tty, struct usb_serial_port *port)
{
{