From 03130ca5a3c876de098e94657ca8094dd1f35078 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sat, 10 Aug 2013 19:33:16 -0600 Subject: [PATCH] STM32: Fix STM32 serial init for non-reordered serial ports. From Lorenz Meier --- arch/arm/src/stm32/stm32_serial.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/arch/arm/src/stm32/stm32_serial.c b/arch/arm/src/stm32/stm32_serial.c index 037ad07db8..3cbcd6a92c 100644 --- a/arch/arm/src/stm32/stm32_serial.c +++ b/arch/arm/src/stm32/stm32_serial.c @@ -2441,10 +2441,17 @@ void up_serialinit(void) for (i = 0; i < STM32_NUSART; i++) { + /* Don't create a device for non-configured ports. */ + + if (uart_devs[i] == 0) + { + continue; + } + #ifndef CONFIG_SERIAL_DISABLE_REORDERING /* Don't create a device for the console - we did that above */ - if ((uart_devs[i] == 0) || (uart_devs[i]->dev.isconsole)) + if (uart_devs[i]->dev.isconsole) { continue; }