diff options
author | Sekhar Nori <nsekhar@ti.com> | 2012-08-28 14:38:05 +0530 |
---|---|---|
committer | Sekhar Nori <nsekhar@ti.com> | 2012-10-27 16:31:04 +0530 |
commit | 09aaf994e37c3e37fd2b0e9b1856038e31ae3b68 (patch) | |
tree | 141d3d0f742c045cb81d314fa0635cab707cc306 /arch/arm/mach-davinci/include | |
parent | 5604f69eec0aed392cea2909ee49dd834b782fac (diff) | |
download | kernel_goldelico_gta04-09aaf994e37c3e37fd2b0e9b1856038e31ae3b68.zip kernel_goldelico_gta04-09aaf994e37c3e37fd2b0e9b1856038e31ae3b68.tar.gz kernel_goldelico_gta04-09aaf994e37c3e37fd2b0e9b1856038e31ae3b68.tar.bz2 |
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>
Diffstat (limited to 'arch/arm/mach-davinci/include')
-rw-r--r-- | arch/arm/mach-davinci/include/mach/uncompress.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/arm/mach-davinci/include/mach/uncompress.h b/arch/arm/mach-davinci/include/mach/uncompress.h index 18cfd49..3a0ff90 100644 --- a/arch/arm/mach-davinci/include/mach/uncompress.h +++ b/arch/arm/mach-davinci/include/mach/uncompress.h @@ -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(); } |