Skip to content

Commit

Permalink
nrf_security: Replace device_get_binding with DEVICE_DT_GET
Browse files Browse the repository at this point in the history
Commit changes finding entropy device at run-time to finding
it during compilation.

Signed-off-by: Dominik Ermel <[email protected]>
  • Loading branch information
de-nordic committed May 6, 2022
1 parent 83225e4 commit c6ee51f
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions nrf_security/src/legacy/entropy_poll.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ int mbedtls_hardware_poll(void *data,
size_t len,
size_t *olen )
{
const struct device *dev;
const struct device *dev = DEVICE_DT_GET(DT_CHOSEN(zephyr_entropy));
size_t chunk_size;

(void)data;
Expand All @@ -35,11 +35,9 @@ int mbedtls_hardware_poll(void *data,
return -1;
}

dev = device_get_binding(DT_CHOSEN_ZEPHYR_ENTROPY_LABEL);

if (!dev)
if (!device_is_ready(dev))
{
return MBEDTLS_ERR_ENTROPY_NO_SOURCES_DEFINED;
return MBEDTLS_ERR_ENTROPY_SOURCE_FAILED;
}

while (len > 0)
Expand Down

0 comments on commit c6ee51f

Please sign in to comment.