diff options
author | Jiri Slaby <jslaby@suse.cz> | 2013-01-03 09:53:04 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-01-16 01:22:35 -0500 |
commit | 05c7cd39907184328f48d3e7899f9cdd653ad336 (patch) | |
tree | 9d1ed5c757426aa20b7eccd853faa6b519a4aa7b /drivers/tty/serial/sunhv.c | |
parent | 92a19f9cec9a80ad93c06e115822deb729e2c6ad (diff) |
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>
Diffstat (limited to 'drivers/tty/serial/sunhv.c')
-rw-r--r-- | drivers/tty/serial/sunhv.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/tty/serial/sunhv.c b/drivers/tty/serial/sunhv.c index bbb102e3c035..defe92b19e16 100644 --- a/drivers/tty/serial/sunhv.c +++ b/drivers/tty/serial/sunhv.c | |||
@@ -72,7 +72,7 @@ static void transmit_chars_write(struct uart_port *port, struct circ_buf *xmit) | |||
72 | } | 72 | } |
73 | } | 73 | } |
74 | 74 | ||
75 | static int receive_chars_getchar(struct uart_port *port, struct tty_struct *tty) | 75 | static int receive_chars_getchar(struct uart_port *port) |
76 | { | 76 | { |
77 | int saw_console_brk = 0; | 77 | int saw_console_brk = 0; |
78 | int limit = 10000; | 78 | int limit = 10000; |
@@ -115,7 +115,7 @@ static int receive_chars_getchar(struct uart_port *port, struct tty_struct *tty) | |||
115 | return saw_console_brk; | 115 | return saw_console_brk; |
116 | } | 116 | } |
117 | 117 | ||
118 | static int receive_chars_read(struct uart_port *port, struct tty_struct *tty) | 118 | static int receive_chars_read(struct uart_port *port) |
119 | { | 119 | { |
120 | int saw_console_brk = 0; | 120 | int saw_console_brk = 0; |
121 | int limit = 10000; | 121 | int limit = 10000; |
@@ -152,12 +152,13 @@ static int receive_chars_read(struct uart_port *port, struct tty_struct *tty) | |||
152 | for (i = 0; i < bytes_read; i++) | 152 | for (i = 0; i < bytes_read; i++) |
153 | uart_handle_sysrq_char(port, con_read_page[i]); | 153 | uart_handle_sysrq_char(port, con_read_page[i]); |
154 | 154 | ||
155 | if (tty == NULL) | 155 | if (port->state == NULL) |
156 | continue; | 156 | continue; |
157 | 157 | ||
158 | port->icount.rx += bytes_read; | 158 | port->icount.rx += bytes_read; |
159 | 159 | ||
160 | tty_insert_flip_string(tty, con_read_page, bytes_read); | 160 | tty_insert_flip_string(&port->state->port, con_read_page, |
161 | bytes_read); | ||
161 | } | 162 | } |
162 | 163 | ||
163 | return saw_console_brk; | 164 | return saw_console_brk; |
@@ -165,7 +166,7 @@ static int receive_chars_read(struct uart_port *port, struct tty_struct *tty) | |||
165 | 166 | ||
166 | struct sunhv_ops { | 167 | struct sunhv_ops { |
167 | void (*transmit_chars)(struct uart_port *port, struct circ_buf *xmit); | 168 | void (*transmit_chars)(struct uart_port *port, struct circ_buf *xmit); |
168 | int (*receive_chars)(struct uart_port *port, struct tty_struct *tty); | 169 | int (*receive_chars)(struct uart_port *port); |
169 | }; | 170 | }; |
170 | 171 | ||
171 | static struct sunhv_ops bychar_ops = { | 172 | static struct sunhv_ops bychar_ops = { |
@@ -187,7 +188,7 @@ static struct tty_struct *receive_chars(struct uart_port *port) | |||
187 | if (port->state != NULL) /* Unopened serial console */ | 188 | if (port->state != NULL) /* Unopened serial console */ |
188 | tty = port->state->port.tty; | 189 | tty = port->state->port.tty; |
189 | 190 | ||
190 | if (sunhv_ops->receive_chars(port, tty)) | 191 | if (sunhv_ops->receive_chars(port)) |
191 | sun_do_break(); | 192 | sun_do_break(); |
192 | 193 | ||
193 | return tty; | 194 | return tty; |