aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorSekhar Nori <nsekhar@ti.com>2012-08-28 05:08:05 -0400
committerSekhar Nori <nsekhar@ti.com>2012-10-27 07:01:04 -0400
commit09aaf994e37c3e37fd2b0e9b1856038e31ae3b68 (patch)
tree141d3d0f742c045cb81d314fa0635cab707cc306 /arch/arm
parent5604f69eec0aed392cea2909ee49dd834b782fac (diff)
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')
-rw-r--r--arch/arm/mach-davinci/include/mach/uncompress.h6
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 18cfd4977155..3a0ff905a69b 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;
32/* PORT_16C550A, in polled non-fifo mode */ 32/* PORT_16C550A, in polled non-fifo mode */
33static void putc(char c) 33static void putc(char c)
34{ 34{
35 if (!uart)
36 return;
37
35 while (!(uart[UART_LSR] & UART_LSR_THRE)) 38 while (!(uart[UART_LSR] & UART_LSR_THRE))
36 barrier(); 39 barrier();
37 uart[UART_TX] = c; 40 uart[UART_TX] = c;
@@ -39,6 +42,9 @@ static void putc(char c)
39 42
40static inline void flush(void) 43static inline void flush(void)
41{ 44{
45 if (!uart)
46 return;
47
42 while (!(uart[UART_LSR] & UART_LSR_THRE)) 48 while (!(uart[UART_LSR] & UART_LSR_THRE))
43 barrier(); 49 barrier();
44} 50}