aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDoug Anderson2014-04-21 09:40:35 -0700
committerGreg Kroah-Hartman2014-04-24 15:38:21 -0700
commitab88c8dc3bd667bcf21c8319165db92b930cf7e7 (patch)
tree060c678b26d846eab33e1861862c0191e27e269f
parentbb7f09ba961dd43a2398975cc2d4ad0eb77ec865 (diff)
serial: samsung: don't check config for every character
The s3c24xx_serial_console_putchar() is _only_ ever used by s3c24xx_serial_console_write() and is called in a loop (indirectly through uart_console_write()). There's no reason to call s3c24xx_port_configured() for every iteration through the loop. Move it outside the loop. Signed-off-by: Doug Anderson <dianders@chromium.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/tty/serial/samsung.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/tty/serial/samsung.c b/drivers/tty/serial/samsung.c
index a8e8b796f4f7..12442748d69f 100644
--- a/drivers/tty/serial/samsung.c
+++ b/drivers/tty/serial/samsung.c
@@ -1464,11 +1464,6 @@ static void
s3c24xx_serial_console_putchar(struct uart_port *port, int ch)
{
unsigned int ufcon = rd_regl(port, S3C2410_UFCON);
- unsigned int ucon = rd_regl(port, S3C2410_UCON);
-
- /* not possible to xmit on unconfigured port */
- if (!s3c24xx_port_configured(ucon))
- return;
while (!s3c24xx_serial_console_txrdy(port, ufcon))
barrier();
@@ -1479,6 +1474,12 @@ static void
s3c24xx_serial_console_write(struct console *co, const char *s,
unsigned int count)
{
+ unsigned int ucon = rd_regl(cons_uart, S3C2410_UCON);
+
+ /* not possible to xmit on unconfigured port */
+ if (!s3c24xx_port_configured(ucon))
+ return;
+
uart_console_write(cons_uart, s, count, s3c24xx_serial_console_putchar);
}