drivers: serial: Refactor drivers to use shared init priority Kconfig

Refactors all of the serial drivers to use a shared driver class
initialization priority configuration, CONFIG_SERIAL_INIT_PRIORITY, to
allow configuring serial drivers separately from other devices. This is
similar to other driver classes like I2C and SPI.

The default is set to CONFIG_KERNEL_INIT_PRIORITY_DEVICE to preserve the
existing default initialization priority for most drivers. The one
exception is uart_lpc11u6x.c which previously used
CONFIG_KERNEL_INIT_PRIORITY_OBJECTS.

This change was motivated by an issue on the frdm_k64f board where the
serial driver was incorrectly initialized before the clock control
driver.

Signed-off-by: Maureen Helm <maureen.helm@intel.com>
This commit is contained in:
Maureen Helm 2021-10-14 09:38:10 -05:00 committed by Anas Nashif
commit ad1450510a
44 changed files with 62 additions and 56 deletions

View file

@ -446,7 +446,7 @@ DEVICE_DT_DEFINE(DT_NODELABEL(uart0),
&lpc11u6x_uart0_init,
NULL,
&uart0_data, &uart0_config,
PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_OBJECTS,
PRE_KERNEL_1, CONFIG_SERIAL_INIT_PRIORITY,
&uart0_api);
#ifdef CONFIG_UART_INTERRUPT_DRIVEN
@ -904,7 +904,7 @@ static struct lpc11u6x_uartx_data uart_data_##idx; \
DEVICE_DT_DEFINE(DT_NODELABEL(uart##idx), \
&lpc11u6x_uartx_init, NULL, \
&uart_data_##idx, &uart_cfg_##idx, \
PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_OBJECTS, \
PRE_KERNEL_1, CONFIG_SERIAL_INIT_PRIORITY, \
&uartx_api)
#if DT_NODE_HAS_STATUS(DT_NODELABEL(uart1), okay)