Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 304177
b: refs/heads/master
c: 35f95fd
h: refs/heads/master
i:
  304175: 7e5017f
v: v3
  • Loading branch information
Jiri Slaby authored and Greg Kroah-Hartman committed Apr 9, 2012
1 parent d4ed03a commit 6652294
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 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: 266e37efbc28b051c1ffb1cdcf0a949973e660e3
refs/heads/master: 35f95fd7f234d2b58803bab6f6ebd6bb988050a2
19 changes: 9 additions & 10 deletions trunk/drivers/usb/gadget/u_serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ struct gs_port {
spinlock_t port_lock; /* guard port_* access */

struct gserial *port_usb;
struct tty_struct *port_tty;

bool openclose; /* open/close in progress */
u8 port_num;
Expand Down Expand Up @@ -412,8 +411,8 @@ __acquires(&port->port_lock)
break;
}

if (do_tty_wake && port->port_tty)
tty_wakeup(port->port_tty);
if (do_tty_wake && port->port.tty)
tty_wakeup(port->port.tty);
return status;
}

Expand All @@ -435,7 +434,7 @@ __acquires(&port->port_lock)
struct tty_struct *tty;

/* no more rx if closed */
tty = port->port_tty;
tty = port->port.tty;
if (!tty)
break;

Expand Down Expand Up @@ -488,7 +487,7 @@ static void gs_rx_push(unsigned long _port)

/* hand any queued data to the tty */
spin_lock_irq(&port->port_lock);
tty = port->port_tty;
tty = port->port.tty;
while (!list_empty(queue)) {
struct usb_request *req;

Expand Down Expand Up @@ -699,7 +698,7 @@ static int gs_start_io(struct gs_port *port)

/* unblock any pending writes into our circular buffer */
if (started) {
tty_wakeup(port->port_tty);
tty_wakeup(port->port.tty);
} else {
gs_free_requests(ep, head, &port->read_allocated);
gs_free_requests(port->port_usb->in, &port->write_pool,
Expand Down Expand Up @@ -793,7 +792,7 @@ static int gs_open(struct tty_struct *tty, struct file *file)
/* REVISIT maybe wait for "carrier detect" */

tty->driver_data = port;
port->port_tty = tty;
port->port.tty = tty;

port->port.count = 1;
port->openclose = false;
Expand Down Expand Up @@ -879,7 +878,7 @@ static void gs_close(struct tty_struct *tty, struct file *file)
gs_buf_clear(&port->port_write_buf);

tty->driver_data = NULL;
port->port_tty = NULL;
port->port.tty = NULL;

port->openclose = false;

Expand Down Expand Up @@ -1318,8 +1317,8 @@ void gserial_disconnect(struct gserial *gser)
gser->ioport = NULL;
if (port->port.count > 0 || port->openclose) {
wake_up_interruptible(&port->drain_wait);
if (port->port_tty)
tty_hangup(port->port_tty);
if (port->port.tty)
tty_hangup(port->port.tty);
}
spin_unlock_irqrestore(&port->port_lock, flags);

Expand Down

0 comments on commit 6652294

Please sign in to comment.