Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 325794
b: refs/heads/master
c: c7f3e70
h: refs/heads/master
v: v3
  • Loading branch information
Anton Vorontsov authored and Greg Kroah-Hartman committed Sep 26, 2012
1 parent 3a22c1d commit b0858c6
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 729043e82cdd403a131127254528afea8031ebab
refs/heads/master: c7f3e7087ab0abb52bb1286010f2c104fd38ca5c
17 changes: 17 additions & 0 deletions trunk/drivers/tty/serial/serial_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -2129,6 +2129,7 @@ static int uart_poll_init(struct tty_driver *driver, int line, char *options)
int bits = 8;
int parity = 'n';
int flow = 'n';
int ret;

if (!state || !state->uart_port)
return -1;
Expand All @@ -2137,6 +2138,22 @@ static int uart_poll_init(struct tty_driver *driver, int line, char *options)
if (!(port->ops->poll_get_char && port->ops->poll_put_char))
return -1;

if (port->ops->poll_init) {
struct tty_port *tport = &state->port;

ret = 0;
mutex_lock(&tport->mutex);
/*
* We don't set ASYNCB_INITIALIZED as we only initialized the
* hw, e.g. state->xmit is still uninitialized.
*/
if (!test_bit(ASYNCB_INITIALIZED, &tport->flags))
ret = port->ops->poll_init(port);
mutex_unlock(&tport->mutex);
if (ret)
return ret;
}

if (options) {
uart_parse_options(options, &baud, &parity, &bits, &flow);
return uart_set_options(port, NULL, baud, parity, bits, flow);
Expand Down
1 change: 1 addition & 0 deletions trunk/include/linux/serial_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ struct uart_ops {
int (*verify_port)(struct uart_port *, struct serial_struct *);
int (*ioctl)(struct uart_port *, unsigned int, unsigned long);
#ifdef CONFIG_CONSOLE_POLL
int (*poll_init)(struct uart_port *);
void (*poll_put_char)(struct uart_port *, unsigned char);
int (*poll_get_char)(struct uart_port *);
#endif
Expand Down

0 comments on commit b0858c6

Please sign in to comment.