summaryrefslogtreecommitdiff
path: root/drivers/tty/serial/sc26xx.c
diff options
context:
space:
mode:
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)
static struct tty_struct *receive_chars(struct uart_port *port)
{
+ struct tty_port *tport = NULL;
struct tty_struct *tty = NULL;
int limit = 10000;
unsigned char ch;
char flag;
u8 status;
- if (port->state != NULL) /* Unopened serial console */
- tty = port->state->port.tty;
+ /* FIXME what is this trying to achieve? */
+ if (port->state != NULL) { /* Unopened serial console */
+ tport = &port->state->port;
+ tty = tport->tty;
+ }
while (limit-- > 0) {
status = READ_SC_PORT(port, SR);
@@ -185,7 +189,7 @@ static struct tty_struct *receive_chars(struct uart_port *port)
if (status & port->ignore_status_mask)
continue;
- tty_insert_flip_char(tty, ch, flag);
+ tty_insert_flip_char(tport, ch, flag);
}
return tty;
}