USB: ark3116: remove bogus disconnect test in close
authorJohan Hovold <jhovold@gmail.com>
Thu, 21 Mar 2013 11:36:28 +0000 (12:36 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 25 Mar 2013 20:44:17 +0000 (13:44 -0700)
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: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/serial/ark3116.c

index 4775f82..3b811fe 100644 (file)
@@ -341,18 +341,15 @@ static void ark3116_close(struct usb_serial_port *port)
 {
        struct usb_serial *serial = port->serial;
 
-       if (serial->dev) {
-               /* disable DMA */
-               ark3116_write_reg(serial, UART_FCR, 0);
-
-               /* deactivate interrupts */
-               ark3116_write_reg(serial, UART_IER, 0);
+       /* disable DMA */
+       ark3116_write_reg(serial, UART_FCR, 0);
 
-               usb_serial_generic_close(port);
-               if (serial->num_interrupt_in)
-                       usb_kill_urb(port->interrupt_in_urb);
-       }
+       /* deactivate interrupts */
+       ark3116_write_reg(serial, UART_IER, 0);
 
+       usb_serial_generic_close(port);
+       if (serial->num_interrupt_in)
+               usb_kill_urb(port->interrupt_in_urb);
 }
 
 static int ark3116_open(struct tty_struct *tty, struct usb_serial_port *port)