mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-22 23:04:43 +00:00
ARM: davinci: uncompress.h: bail out if uart not initialized
Bail out of UART access functions in uncompress.h if the uart port is not setup. This will happen when booting from DT since machine type matching does not work in this case. This may also happen if a correct machine type is not setup by bootloader. Signed-off-by: Sekhar Nori <nsekhar@ti.com>
This commit is contained in:
parent
5604f69eec
commit
09aaf994e3
1 changed files with 6 additions and 0 deletions
|
@ -32,6 +32,9 @@ u32 *uart;
|
|||
/* PORT_16C550A, in polled non-fifo mode */
|
||||
static void putc(char c)
|
||||
{
|
||||
if (!uart)
|
||||
return;
|
||||
|
||||
while (!(uart[UART_LSR] & UART_LSR_THRE))
|
||||
barrier();
|
||||
uart[UART_TX] = c;
|
||||
|
@ -39,6 +42,9 @@ static void putc(char c)
|
|||
|
||||
static inline void flush(void)
|
||||
{
|
||||
if (!uart)
|
||||
return;
|
||||
|
||||
while (!(uart[UART_LSR] & UART_LSR_THRE))
|
||||
barrier();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue