s5j/serial: fix compilation errors when UARTs are disabled
authorHeesub Shin <heesub.shin@samsung.com>
Wed, 26 Apr 2017 12:13:08 +0000 (21:13 +0900)
committerHeesub Shin <heesub.shin@samsung.com>
Sat, 6 May 2017 14:00:39 +0000 (23:00 +0900)
When CONFIG_S5J_UARTx is not set, compiler complains as following:

CC: chip/s5j_serial.c
    chip/s5j_serial.c: In function 'up_setup':
    chip/s5j_serial.c:1016:12: error: 'g_uart0priv' undeclared (first use in this function)
        priv = &g_uart0priv;
                ^
    chip/s5j_serial.c:1016:12: note: each undeclared identifier is reported only once for each function it appears in
    chip/s5j_serial.c:1019:12: error: 'g_uart1priv' undeclared (first use in this function)
        priv = &g_uart1priv;
                ^
    chip/s5j_serial.c:1022:12: error: 'g_uart2priv' undeclared (first use in this function)
        priv = &g_uart2priv;
                ^
    chip/s5j_serial.c:1025:12: error: 'g_uart3priv' undeclared (first use in this function)
        priv = &g_uart3priv;
                ^
    Makefile:175: recipe for target 's5j_serial.o' failed
    make[1]: *** [s5j_serial.o] Error 1

This commit fixes this.

Change-Id: Ifd56c89547071e1a96765e32cea984ac7234d181
Signed-off-by: Heesub Shin <heesub.shin@samsung.com>
os/arch/arm/src/s5j/s5j_serial.c

index 2fa39cb..733debe 100644 (file)
@@ -1012,22 +1012,32 @@ static int up_setup(struct uart_dev_s *dev)
        /* Initialize UART */
 
        switch (priv->eCh) {
+#ifdef CONFIG_S5J_UART0
                case UART0:
                        priv = &g_uart0priv;
                        break;
+#endif
+#ifdef CONFIG_S5J_UART1
                case UART1:
                        priv = &g_uart1priv;
                        break;
+#endif
+#ifdef CONFIG_S5J_UART2
                case UART2:
                        priv = &g_uart2priv;
                        break;
+#endif
+#ifdef CONFIG_S5J_UART3
                case UART3:
                        priv = &g_uart3priv;
                        break;
+#endif
+#ifdef CONFIG_S5J_UARTDBG
                case UARTDBG:
                default:
                        priv = &g_uartdbgpriv;
                        break;
+#endif
        }
 
        /* wait until every characters from earlier stage bootloader get out */