driver: uart: clock control code refactoring

Small code refactorisation in order to ease up coming
support of stm32f1 series by stm32 commom clock control
driver

Change-Id: I486cfba137cd048d65f0732e10aa29d877bb03e5
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
This commit is contained in:
Erwan Gouriou 2017-04-11 11:06:05 +02:00 committed by Kumar Gala
commit 424c33825c

View file

@ -285,11 +285,11 @@ static int uart_stm32_init(struct device *dev)
__uart_stm32_get_clock(dev); __uart_stm32_get_clock(dev);
/* enable clock */ /* enable clock */
#if defined(CONFIG_SOC_SERIES_STM32F1X) #ifdef CONFIG_CLOCK_CONTROL_STM32_CUBE
clock_control_on(data->clock, config->clock_subsys);
#elif defined(CONFIG_CLOCK_CONTROL_STM32_CUBE)
clock_control_on(data->clock, clock_control_on(data->clock,
(clock_control_subsys_t *)&config->pclken); (clock_control_subsys_t *)&config->pclken);
#else
clock_control_on(data->clock, config->clock_subsys);
#endif #endif
UartHandle->Instance = UART_STRUCT(dev); UartHandle->Instance = UART_STRUCT(dev);