aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty/serial/sc26xx.c
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2013-01-03 09:53:03 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-01-16 01:21:36 -0500
commit92a19f9cec9a80ad93c06e115822deb729e2c6ad (patch)
tree80e1550ac1647a1cdf20a0b568554c0c50a63f75 /drivers/tty/serial/sc26xx.c
parent2f69335710884ae6112fc8196ebe29b5cda7b79b (diff)
TTY: switch tty_insert_flip_char
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_char is the next one to proceed. This one is used all over the code, so the patch is huge. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/serial/sc26xx.c')
-rw-r--r--drivers/tty/serial/sc26xx.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/tty/serial/sc26xx.c b/drivers/tty/serial/sc26xx.c
index aced1dd923d8..0cd0e4ac12a6 100644
--- a/drivers/tty/serial/sc26xx.c
+++ b/drivers/tty/serial/sc26xx.c
@@ -138,14 +138,18 @@ static void sc26xx_disable_irq(struct uart_port *port, int mask)
138 138
139static struct tty_struct *receive_chars(struct uart_port *port) 139static struct tty_struct *receive_chars(struct uart_port *port)
140{ 140{
141 struct tty_port *tport = NULL;
141 struct tty_struct *tty = NULL; 142 struct tty_struct *tty = NULL;
142 int limit = 10000; 143 int limit = 10000;
143 unsigned char ch; 144 unsigned char ch;
144 char flag; 145 char flag;
145 u8 status; 146 u8 status;
146 147
147 if (port->state != NULL) /* Unopened serial console */ 148 /* FIXME what is this trying to achieve? */
148 tty = port->state->port.tty; 149 if (port->state != NULL) { /* Unopened serial console */
150 tport = &port->state->port;
151 tty = tport->tty;
152 }
149 153
150 while (limit-- > 0) { 154 while (limit-- > 0) {
151 status = READ_SC_PORT(port, SR); 155 status = READ_SC_PORT(port, SR);
@@ -185,7 +189,7 @@ static struct tty_struct *receive_chars(struct uart_port *port)
185 if (status & port->ignore_status_mask) 189 if (status & port->ignore_status_mask)
186 continue; 190 continue;
187 191
188 tty_insert_flip_char(tty, ch, flag); 192 tty_insert_flip_char(tport, ch, flag);
189 } 193 }
190 return tty; 194 return tty;
191} 195}