aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/usb-serial.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/serial/usb-serial.c')
-rw-r--r--drivers/usb/serial/usb-serial.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c
index 2e70efa08b77..bbe7f2eb8160 100644
--- a/drivers/usb/serial/usb-serial.c
+++ b/drivers/usb/serial/usb-serial.c
@@ -257,22 +257,18 @@ static int serial_open(struct tty_struct *tty, struct file *filp)
257 * serial_down - shut down hardware 257 * serial_down - shut down hardware
258 * @tport: tty port to shut down 258 * @tport: tty port to shut down
259 * 259 *
260 * Shut down a USB serial port unless it is the console. We never 260 * Shut down a USB serial port. Serialized against activate by the
261 * shut down the console hardware as it will always be in use. Serialized 261 * tport mutex and kept to matching open/close pairs
262 * against activate by the tport mutex and kept to matching open/close pairs
263 * of calls by the ASYNCB_INITIALIZED flag. 262 * of calls by the ASYNCB_INITIALIZED flag.
263 *
264 * Not called if tty is console.
264 */ 265 */
265static void serial_down(struct tty_port *tport) 266static void serial_down(struct tty_port *tport)
266{ 267{
267 struct usb_serial_port *port = 268 struct usb_serial_port *port =
268 container_of(tport, struct usb_serial_port, port); 269 container_of(tport, struct usb_serial_port, port);
269 struct usb_serial_driver *drv = port->serial->type; 270 struct usb_serial_driver *drv = port->serial->type;
270 /* 271
271 * The console is magical. Do not hang up the console hardware
272 * or there will be tears.
273 */
274 if (port->port.console)
275 return;
276 if (drv->close) 272 if (drv->close)
277 drv->close(port); 273 drv->close(port);
278} 274}