summaryrefslogtreecommitdiff
path: root/drivers/tty/serial/mvf.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/tty/serial/mvf.c')
-rw-r--r--drivers/tty/serial/mvf.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/tty/serial/mvf.c b/drivers/tty/serial/mvf.c
index 814a7daa56f0..ae35ffdf4907 100644
--- a/drivers/tty/serial/mvf.c
+++ b/drivers/tty/serial/mvf.c
@@ -373,7 +373,8 @@ static void rx_work(struct work_struct *w)
struct imx_port *sport = container_of(w, struct imx_port, tsk_rx);
struct tty_struct *tty = sport->port.state->port.tty;
- if (sport->rx_bytes) {
+ /* check if tty is valid, since the process might be gone... */
+ if (sport->rx_bytes && tty) {
tty_flip_buffer_push(tty);
sport->rx_bytes = 0;
}
@@ -562,6 +563,7 @@ static int imx_setup_watermark(struct imx_port *sport, unsigned int mode)
MXC_UARTPFIFO_TXFIFOSIZE_MASK) + 1);
sport->rx_fifo_size = 0x1 << (((val >> MXC_UARTPFIFO_RXFIFOSIZE_OFF) &
MXC_UARTPFIFO_RXFIFOSIZE_MASK) + 1);
+
writeb(val | MXC_UARTPFIFO_TXFE | MXC_UARTPFIFO_RXFE,
sport->port.membase + MXC_UARTPFIFO);
@@ -586,10 +588,8 @@ static int imx_startup(struct uart_port *port)
struct tty_struct *tty;
struct imxuart_platform_data *pdata = port->dev->platform_data;
-#ifndef CONFIG_SERIAL_CORE_CONSOLE
if (sport->fifo_en)
imx_setup_watermark(sport, 0);
-#endif
/*
* Allocate the IRQ(s)