Skip to content

Commit

Permalink
devices: entropy: Initialize drivers during PRE_KERNEL_1 stage
Browse files Browse the repository at this point in the history
To ensure that early code that requires entropy has the HWRNG devices
fully initialized, initialize them all during PRE_KERNEL_1 stage.

Signed-off-by: Leandro Pereira <[email protected]>
  • Loading branch information
lpereira authored and andrewboie committed May 22, 2018
1 parent 99f36de commit 30e558f
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion drivers/entropy/entropy_mcux_rnga.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ static int entropy_mcux_rnga_init(struct device *);

DEVICE_AND_API_INIT(entropy_mcux_rnga, CONFIG_ENTROPY_NAME,
entropy_mcux_rnga_init, NULL, NULL,
PRE_KERNEL_2, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
&entropy_mcux_rnga_api_funcs);

static int entropy_mcux_rnga_init(struct device *dev)
Expand Down
2 changes: 1 addition & 1 deletion drivers/entropy/entropy_mcux_trng.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ static int entropy_mcux_trng_init(struct device *);

DEVICE_AND_API_INIT(entropy_mcux_trng, CONFIG_ENTROPY_NAME,
entropy_mcux_trng_init, NULL, NULL,
PRE_KERNEL_2, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
&entropy_mcux_trng_api_funcs);

static int entropy_mcux_trng_init(struct device *dev)
Expand Down
2 changes: 1 addition & 1 deletion drivers/entropy/entropy_stm32.c
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ static struct entropy_stm32_rng_dev_data entropy_stm32_rng_data = {
DEVICE_AND_API_INIT(entropy_stm32_rng, CONFIG_ENTROPY_NAME,
entropy_stm32_rng_init,
&entropy_stm32_rng_data, &entropy_stm32_rng_config,
PRE_KERNEL_2, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
&entropy_stm32_rng_api);

#endif
2 changes: 1 addition & 1 deletion drivers/entropy/fake_entropy_native_posix.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,6 @@ static const struct entropy_driver_api entropy_native_posix_api_funcs = {

DEVICE_AND_API_INIT(entropy_native_posix, CONFIG_ENTROPY_NAME,
entropy_native_posix_init, NULL, NULL,
PRE_KERNEL_2, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
&entropy_native_posix_api_funcs);

0 comments on commit 30e558f

Please sign in to comment.