Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 155385
b: refs/heads/master
c: 6e40612
h: refs/heads/master
i:
  155383: 6b16bb9
v: v3
  • Loading branch information
Jason Wessel authored and Greg Kroah-Hartman committed Jul 12, 2009
1 parent daa262e commit 04e945e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: bf7fbb022f0a3da27a2bcf8d7c973c813d942384
refs/heads/master: 6e4061210150d1d6d388c5fba05f6b49a306a27e
13 changes: 7 additions & 6 deletions trunk/drivers/usb/serial/console.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,11 @@ static int usb_console_setup(struct console *co, char *options)
kfree(tty);
}
}
/* So we know not to kill the hardware on a hangup on this
port. We have also bumped the use count by one so it won't go
idle */
/* Now that any required fake tty operations are completed restore
* the tty port count */
--port->port.count;
/* The console is special in terms of closing the device so
* indicate this port is now acting as a system console. */
port->console = 1;
retval = 0;

Expand Down Expand Up @@ -204,7 +206,7 @@ static void usb_console_write(struct console *co,

dbg("%s - port %d, %d byte(s)", __func__, port->number, count);

if (!port->port.count) {
if (!port->console) {
dbg("%s - port not opened", __func__);
return;
}
Expand Down Expand Up @@ -300,8 +302,7 @@ void usb_serial_console_exit(void)
{
if (usbcons_info.port) {
unregister_console(&usbcons);
if (usbcons_info.port->port.count)
usbcons_info.port->port.count--;
usbcons_info.port->console = 0;
usbcons_info.port = NULL;
}
}
Expand Down
3 changes: 2 additions & 1 deletion trunk/drivers/usb/serial/usb-serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,8 @@ static int serial_open (struct tty_struct *tty, struct file *filp)
tty->driver_data = port;
tty_port_tty_set(&port->port, tty);

if (port->port.count == 1) {
/* If the console is attached, the device is already open */
if (port->port.count == 1 && !port->console) {

/* lock this module before we call it
* this may fail, which means we must bail out,
Expand Down

0 comments on commit 04e945e

Please sign in to comment.