]> git.sur5r.net Git - u-boot/blobdiff - cpu/lh7a40x/serial.c
Minor spelling fix in comment.
[u-boot] / cpu / lh7a40x / serial.c
index 241d568ea9f123c09c08dabdf710a0d758336487..2132c052a4e1a3b372751a91c1793fa2ba51dc80 100644 (file)
@@ -21,6 +21,8 @@
 #include <common.h>
 #include <lh7a40x.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #if defined(CONFIG_CONSOLE_UART1)
 # define UART_CONSOLE 1
 #elif defined(CONFIG_CONSOLE_UART2)
@@ -33,8 +35,7 @@
 
 void serial_setbrg (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-       LH7A40X_UART_PTR(uart,UART_CONSOLE);
+       lh7a40x_uart_t* uart = LH7A40X_UART_PTR(UART_CONSOLE);
        int i;
        unsigned int reg = 0;
 
@@ -62,7 +63,7 @@ void serial_setbrg (void)
  */
 int serial_init (void)
 {
-       LH7A40X_UART_PTR(uart,UART_CONSOLE);
+       lh7a40x_uart_t* uart = LH7A40X_UART_PTR(UART_CONSOLE);
 
        /* UART must be enabled before writing to any config registers */
        uart->con |= (UART_EN);
@@ -96,7 +97,7 @@ int serial_init (void)
  */
 int serial_getc (void)
 {
-       LH7A40X_UART_PTR(uart,UART_CONSOLE);
+       lh7a40x_uart_t* uart = LH7A40X_UART_PTR(UART_CONSOLE);
 
        /* wait for character to arrive */
        while (uart->status & UART_RXFE);
@@ -142,7 +143,7 @@ void enable_putc(void)
  */
 void serial_putc (const char c)
 {
-       LH7A40X_UART_PTR(uart,UART_CONSOLE);
+       lh7a40x_uart_t* uart = LH7A40X_UART_PTR(UART_CONSOLE);
 
 #ifdef CONFIG_MODEM_SUPPORT
        if (be_quiet)
@@ -169,7 +170,7 @@ void serial_putc (const char c)
  */
 int serial_tstc (void)
 {
-       LH7A40X_UART_PTR(uart,UART_CONSOLE);
+       lh7a40x_uart_t* uart = LH7A40X_UART_PTR(UART_CONSOLE);
 
        return(!(uart->status & UART_RXFE));
 }