Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 122135
b: refs/heads/master
c: 4a3e818
h: refs/heads/master
i:
  122133: 425d870
  122131: 30a9ef8
  122127: 6390ae4
v: v3
  • Loading branch information
Denis Joseph Barrow authored and David S. Miller committed Nov 25, 2008
1 parent b2ee755 commit 14d04e2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 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: bab04c3adbb55aeb5e8db60522f14ce0bb0d4179
refs/heads/master: 4a3e818181e1baf970e9232ca8b747e233176b87
11 changes: 9 additions & 2 deletions trunk/drivers/net/usb/hso.c
Original file line number Diff line number Diff line change
Expand Up @@ -1235,6 +1235,11 @@ static int hso_serial_open(struct tty_struct *tty, struct file *filp)
}

mutex_lock(&serial->parent->mutex);
/* check for port already opened, if not set the termios */
/* The serial->open count needs to be here as hso_serial_close
* will be called even if hso_serial_open returns -ENODEV.
*/
serial->open_count++;
result = usb_autopm_get_interface(serial->parent->interface);
if (result < 0)
goto err_out;
Expand All @@ -1246,8 +1251,6 @@ static int hso_serial_open(struct tty_struct *tty, struct file *filp)
tty->driver_data = serial;
serial->tty = tty;

/* check for port already opened, if not set the termios */
serial->open_count++;
if (serial->open_count == 1) {
tty->low_latency = 1;
serial->rx_state = RX_IDLE;
Expand Down Expand Up @@ -1285,6 +1288,10 @@ static void hso_serial_close(struct tty_struct *tty, struct file *filp)
u8 usb_gone;

D1("Closing serial port");
if (serial == NULL || serial->magic != HSO_SERIAL_MAGIC) {
D1("invalid serial structure bailing out.\n");
return;
}

mutex_lock(&serial->parent->mutex);
usb_gone = serial->parent->usb_gone;
Expand Down

0 comments on commit 14d04e2

Please sign in to comment.