serial: samsung: Use the passed in "port", fixing kgdb w/ no console

The two functions in the samsung serial driver used for writing
characters out to the port were inconsistent about whether they used
the passed in "port" or the global "cons_uart". There was no reason
to use the global and the use of the global in
s3c24xx_serial_put_poll_char() caused a crash in the case where you
used the serial port for kgdboc but not for console.

Fix it so we used the passed in variable.

Note that this doesn't fix all problems with the samsung serial
driver. Specifically:
* s3c24xx_serial_console_putchar() is still 99% identical to
s3c24xx_serial_put_poll_char() (the function signature is different,
but that's about it). A future patch will make them slightly less
identical and judging by other serial drivers we may need yet more
differences eventually.
* The samsung serial driver still doesn't allow you to have more than
one console port since it still uses the global cons_uart in
s3c24xx_serial_console_write().

Signed-off-by: Doug Anderson <dianders@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Doug Anderson and committed by
Greg Kroah-Hartman
bb7f09ba f8fd1b03

+6 -6
+6 -6
drivers/tty/serial/samsung.c
··· 1446 1446 static void s3c24xx_serial_put_poll_char(struct uart_port *port, 1447 1447 unsigned char c) 1448 1448 { 1449 - unsigned int ufcon = rd_regl(cons_uart, S3C2410_UFCON); 1450 - unsigned int ucon = rd_regl(cons_uart, S3C2410_UCON); 1449 + unsigned int ufcon = rd_regl(port, S3C2410_UFCON); 1450 + unsigned int ucon = rd_regl(port, S3C2410_UCON); 1451 1451 1452 1452 /* not possible to xmit on unconfigured port */ 1453 1453 if (!s3c24xx_port_configured(ucon)) ··· 1455 1455 1456 1456 while (!s3c24xx_serial_console_txrdy(port, ufcon)) 1457 1457 cpu_relax(); 1458 - wr_regb(cons_uart, S3C2410_UTXH, c); 1458 + wr_regb(port, S3C2410_UTXH, c); 1459 1459 } 1460 1460 1461 1461 #endif /* CONFIG_CONSOLE_POLL */ ··· 1463 1463 static void 1464 1464 s3c24xx_serial_console_putchar(struct uart_port *port, int ch) 1465 1465 { 1466 - unsigned int ufcon = rd_regl(cons_uart, S3C2410_UFCON); 1467 - unsigned int ucon = rd_regl(cons_uart, S3C2410_UCON); 1466 + unsigned int ufcon = rd_regl(port, S3C2410_UFCON); 1467 + unsigned int ucon = rd_regl(port, S3C2410_UCON); 1468 1468 1469 1469 /* not possible to xmit on unconfigured port */ 1470 1470 if (!s3c24xx_port_configured(ucon)) ··· 1472 1472 1473 1473 while (!s3c24xx_serial_console_txrdy(port, ufcon)) 1474 1474 barrier(); 1475 - wr_regb(cons_uart, S3C2410_UTXH, ch); 1475 + wr_regb(port, S3C2410_UTXH, ch); 1476 1476 } 1477 1477 1478 1478 static void