kernel: use DEVICE_DT_GET_OR_NULL for entropy device
A reference to the entropy device can be obtained at compile time, so avoid using device_get_binding(). Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
This commit is contained in:
parent
be7dabed19
commit
5573d8d11e
1 changed files with 2 additions and 2 deletions
|
@ -362,10 +362,10 @@ __boot_func
|
||||||
void z_early_boot_rand_get(uint8_t *buf, size_t length)
|
void z_early_boot_rand_get(uint8_t *buf, size_t length)
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_ENTROPY_HAS_DRIVER
|
#ifdef CONFIG_ENTROPY_HAS_DRIVER
|
||||||
const struct device *entropy = device_get_binding(DT_CHOSEN_ZEPHYR_ENTROPY_LABEL);
|
const struct device *entropy = DEVICE_DT_GET_OR_NULL(DT_CHOSEN(zephyr_entropy));
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
if (entropy == NULL) {
|
if (!device_is_ready(entropy)) {
|
||||||
goto sys_rand_fallback;
|
goto sys_rand_fallback;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue