drivers/serial: stm32: Put LPUART code under LPUART Kconfig symbol

In order to ease integration of new series, remove reference to
series in code activation. Use LPUART support Kconfig symbol instead.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
This commit is contained in:
Erwan Gouriou 2018-06-18 18:01:06 +02:00 committed by Anas Nashif
commit 13a96574cd

View file

@ -263,7 +263,7 @@ static void uart_stm32_usart_set_baud_rate(struct device *dev,
baud_rate); baud_rate);
} }
#if defined(CONFIG_SOC_SERIES_STM32L0X) || defined(CONFIG_SOC_SERIES_STM32L4X) #ifdef CONFIG_UART_STM32_LPUART_1
static void uart_stm32_lpuart_set_baud_rate(struct device *dev, static void uart_stm32_lpuart_set_baud_rate(struct device *dev,
u32_t clock_rate, u32_t baud_rate) u32_t clock_rate, u32_t baud_rate)
{ {
@ -319,7 +319,7 @@ static int uart_stm32_init(struct device *dev)
(clock_control_subsys_t *)&config->pclken, (clock_control_subsys_t *)&config->pclken,
&clock_rate); &clock_rate);
#if defined(CONFIG_SOC_SERIES_STM32L0X) || defined(CONFIG_SOC_SERIES_STM32L4X) #ifdef CONFIG_UART_STM32_LPUART_1
if (IS_LPUART_INSTANCE(UartInstance)) { if (IS_LPUART_INSTANCE(UartInstance)) {
uart_stm32_lpuart_set_baud_rate(dev, clock_rate, baud_rate); uart_stm32_lpuart_set_baud_rate(dev, clock_rate, baud_rate);
} else { } else {
@ -338,7 +338,7 @@ static int uart_stm32_init(struct device *dev)
#endif /* !USART_ISR_TEACK */ #endif /* !USART_ISR_TEACK */
#ifdef USART_ISR_REACK #ifdef USART_ISR_REACK
/* Wait until TEACK flag is set */ /* Wait until REACK flag is set */
while (!(LL_USART_IsActiveFlag_REACK(UartInstance))) while (!(LL_USART_IsActiveFlag_REACK(UartInstance)))
; ;
#endif /* !USART_ISR_REACK */ #endif /* !USART_ISR_REACK */