drivers: flash: Refactor drivers to use shared init priority

Refactors all of the on-chip flash drivers to use a shared driver class
initialization priority configuration, CONFIG_FLASH_INIT_PRIORITY, to
allow configuring flash 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.

Driver-specific options for SPI-based flash drivers are left intact
because they need to be initialized at a different priority than on-chip
flash drivers.

Signed-off-by: Maureen Helm <maureen.helm@intel.com>
This commit is contained in:
Maureen Helm 2021-12-01 13:13:02 -06:00 committed by Anas Nashif
commit e0cb96c4e3
19 changed files with 26 additions and 18 deletions

View file

@ -1169,7 +1169,7 @@ static struct flash_stm32_qspi_data flash_stm32_qspi_dev_data = {
DEVICE_DT_INST_DEFINE(0, &flash_stm32_qspi_init, NULL,
&flash_stm32_qspi_dev_data, &flash_stm32_qspi_cfg,
POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
POST_KERNEL, CONFIG_FLASH_INIT_PRIORITY,
&flash_stm32_qspi_driver_api);
static void flash_stm32_qspi_irq_config_func(const struct device *dev)