X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=cpu%2Flh7a40x%2Fserial.c;h=2132c052a4e1a3b372751a91c1793fa2ba51dc80;hb=dbab0691d2533560f7e91b92ae844046a9ad1df3;hp=241d568ea9f123c09c08dabdf710a0d758336487;hpb=f39748ae8edb03017647b0d731cdd06e7bdcde13;p=u-boot diff --git a/cpu/lh7a40x/serial.c b/cpu/lh7a40x/serial.c index 241d568ea9..2132c052a4 100644 --- a/cpu/lh7a40x/serial.c +++ b/cpu/lh7a40x/serial.c @@ -21,6 +21,8 @@ #include #include +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)); }