[PATCH] Serial: Add uart_insert_char()

Add uart_insert_char(), which handles inserting characters into the
flip buffer.  This helper function handles the correct semantics
for handling overrun in addition to inserting normal characters.

Signed-off-by: Russell King <rmk@arm.linux.org.uk>
diff --git a/drivers/serial/s3c2410.c b/drivers/serial/s3c2410.c
index 435750d..2a9f7ad 100644
--- a/drivers/serial/s3c2410.c
+++ b/drivers/serial/s3c2410.c
@@ -394,20 +394,7 @@
 		if (uart_handle_sysrq_char(port, ch, regs))
 			goto ignore_char;
 
-		if ((uerstat & port->ignore_status_mask) == 0) {
-			tty_insert_flip_char(tty, ch, flag);
-		}
-
-		if ((uerstat & S3C2410_UERSTAT_OVERRUN) &&
-		    tty->flip.count < TTY_FLIPBUF_SIZE) {
-			/*
-			 * Overrun is special, since it's reported
-			 * immediately, and doesn't affect the current
-			 * character.
-			 */
-
-			tty_insert_flip_char(tty, 0, TTY_OVERRUN);
-		}
+		uart_insert_char(port, uerstat, S3C2410_UERSTAT_OVERRUN, ch, flag);
 
 	ignore_char:
 		continue;