Skip to content

Commit

Permalink
ARM: davinci: uncompress.h: bail out if uart not initialized
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Sekhar Nori committed Oct 27, 2012
1 parent 5604f69 commit 09aaf99
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions arch/arm/mach-davinci/include/mach/uncompress.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,19 @@ 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;
}

static inline void flush(void)
{
if (!uart)
return;

while (!(uart[UART_LSR] & UART_LSR_THRE))
barrier();
}
Expand Down

0 comments on commit 09aaf99

Please sign in to comment.