TTY: switch tty_insert_flip_string

Now, we start converting tty buffer functions to actually use
tty_port. This will allow us to get rid of the need of tty in many
call sites. Only tty_port will needed and hence no more
tty_port_tty_get in those paths.

tty_insert_flip_string this time.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Jiri Slaby
2013-01-03 15:53:04 +01:00
committed by Greg Kroah-Hartman
parent 92a19f9cec
commit 05c7cd3990
62 changed files with 130 additions and 127 deletions

View File

@@ -72,7 +72,7 @@ static void transmit_chars_write(struct uart_port *port, struct circ_buf *xmit)
}
}
static int receive_chars_getchar(struct uart_port *port, struct tty_struct *tty)
static int receive_chars_getchar(struct uart_port *port)
{
int saw_console_brk = 0;
int limit = 10000;
@@ -115,7 +115,7 @@ static int receive_chars_getchar(struct uart_port *port, struct tty_struct *tty)
return saw_console_brk;
}
static int receive_chars_read(struct uart_port *port, struct tty_struct *tty)
static int receive_chars_read(struct uart_port *port)
{
int saw_console_brk = 0;
int limit = 10000;
@@ -152,12 +152,13 @@ static int receive_chars_read(struct uart_port *port, struct tty_struct *tty)
for (i = 0; i < bytes_read; i++)
uart_handle_sysrq_char(port, con_read_page[i]);
if (tty == NULL)
if (port->state == NULL)
continue;
port->icount.rx += bytes_read;
tty_insert_flip_string(tty, con_read_page, bytes_read);
tty_insert_flip_string(&port->state->port, con_read_page,
bytes_read);
}
return saw_console_brk;
@@ -165,7 +166,7 @@ static int receive_chars_read(struct uart_port *port, struct tty_struct *tty)
struct sunhv_ops {
void (*transmit_chars)(struct uart_port *port, struct circ_buf *xmit);
int (*receive_chars)(struct uart_port *port, struct tty_struct *tty);
int (*receive_chars)(struct uart_port *port);
};
static struct sunhv_ops bychar_ops = {
@@ -187,7 +188,7 @@ static struct tty_struct *receive_chars(struct uart_port *port)
if (port->state != NULL) /* Unopened serial console */
tty = port->state->port.tty;
if (sunhv_ops->receive_chars(port, tty))
if (sunhv_ops->receive_chars(port))
sun_do_break();
return tty;