serial/uart_stm32: convert to use DEVICE_AND_API_INIT()
Change-Id: I82ba83453f14761c325b208fc56387411ab8ce40 Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This commit is contained in:
parent
9e575ddbe6
commit
73be1230ee
1 changed files with 15 additions and 11 deletions
|
@ -309,8 +309,6 @@ static int uart_stm32_init(struct device *dev)
|
||||||
/* enable */
|
/* enable */
|
||||||
uart->cr1.bit.ue = 1;
|
uart->cr1.bit.ue = 1;
|
||||||
|
|
||||||
dev->driver_api = &uart_stm32_driver_api;
|
|
||||||
|
|
||||||
#ifdef CONFIG_UART_INTERRUPT_DRIVEN
|
#ifdef CONFIG_UART_INTERRUPT_DRIVEN
|
||||||
cfg->uconf.irq_config_func(dev);
|
cfg->uconf.irq_config_func(dev);
|
||||||
#endif
|
#endif
|
||||||
|
@ -339,9 +337,11 @@ static struct uart_stm32_data uart_stm32_dev_data_0 = {
|
||||||
.baud_rate = CONFIG_UART_STM32_PORT_0_BAUD_RATE,
|
.baud_rate = CONFIG_UART_STM32_PORT_0_BAUD_RATE,
|
||||||
};
|
};
|
||||||
|
|
||||||
DEVICE_INIT(uart_stm32_0, CONFIG_UART_STM32_PORT_0_NAME, &uart_stm32_init,
|
DEVICE_AND_API_INIT(uart_stm32_0, CONFIG_UART_STM32_PORT_0_NAME,
|
||||||
&uart_stm32_dev_data_0, &uart_stm32_dev_cfg_0,
|
&uart_stm32_init,
|
||||||
PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_DEVICE);
|
&uart_stm32_dev_data_0, &uart_stm32_dev_cfg_0,
|
||||||
|
PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
|
||||||
|
&uart_stm32_driver_api);
|
||||||
|
|
||||||
#ifdef CONFIG_UART_INTERRUPT_DRIVEN
|
#ifdef CONFIG_UART_INTERRUPT_DRIVEN
|
||||||
static void uart_stm32_irq_config_func_0(struct device *dev)
|
static void uart_stm32_irq_config_func_0(struct device *dev)
|
||||||
|
@ -381,9 +381,11 @@ static struct uart_stm32_data uart_stm32_dev_data_1 = {
|
||||||
.baud_rate = CONFIG_UART_STM32_PORT_1_BAUD_RATE,
|
.baud_rate = CONFIG_UART_STM32_PORT_1_BAUD_RATE,
|
||||||
};
|
};
|
||||||
|
|
||||||
DEVICE_INIT(uart_stm32_1, CONFIG_UART_STM32_PORT_1_NAME, &uart_stm32_init,
|
DEVICE_AND_API_INIT(uart_stm32_1, CONFIG_UART_STM32_PORT_1_NAME,
|
||||||
&uart_stm32_dev_data_1, &uart_stm32_dev_cfg_1,
|
&uart_stm32_init,
|
||||||
PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_DEVICE);
|
&uart_stm32_dev_data_1, &uart_stm32_dev_cfg_1,
|
||||||
|
PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
|
||||||
|
&uart_stm32_driver_api);
|
||||||
|
|
||||||
#ifdef CONFIG_UART_INTERRUPT_DRIVEN
|
#ifdef CONFIG_UART_INTERRUPT_DRIVEN
|
||||||
static void uart_stm32_irq_config_func_1(struct device *dev)
|
static void uart_stm32_irq_config_func_1(struct device *dev)
|
||||||
|
@ -423,9 +425,11 @@ static struct uart_stm32_data uart_stm32_dev_data_2 = {
|
||||||
.baud_rate = CONFIG_UART_STM32_PORT_2_BAUD_RATE,
|
.baud_rate = CONFIG_UART_STM32_PORT_2_BAUD_RATE,
|
||||||
};
|
};
|
||||||
|
|
||||||
DEVICE_INIT(uart_stm32_2, CONFIG_UART_STM32_PORT_2_NAME, &uart_stm32_init,
|
DEVICE_AND_API_INIT(uart_stm32_2, CONFIG_UART_STM32_PORT_2_NAME,
|
||||||
&uart_stm32_dev_data_2, &uart_stm32_dev_cfg_2,
|
&uart_stm32_init,
|
||||||
PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_DEVICE);
|
&uart_stm32_dev_data_2, &uart_stm32_dev_cfg_2,
|
||||||
|
PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
|
||||||
|
&uart_stm32_driver_api);
|
||||||
|
|
||||||
#ifdef CONFIG_UART_INTERRUPT_DRIVEN
|
#ifdef CONFIG_UART_INTERRUPT_DRIVEN
|
||||||
static void uart_stm32_irq_config_func_2(struct device *dev)
|
static void uart_stm32_irq_config_func_2(struct device *dev)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue