Skip to content

Commit 010730a

Browse files
ananglstephanosio
authored andcommitted
modules: mbedtls: Provide mbedtls_hardware_poll() conditionally
This is a follow-up to commit c7327f5. Wrap implementation of the `mbedtls_hardware_poll()` function in `#if defined(CONFIG_MBEDTLS_ZEPHYR_ENTROPY)` so that the function is provided only when that option is activated. Signed-off-by: Andrzej Głąbek <[email protected]>
1 parent 6a93975 commit 010730a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

modules/mbedtls/zephyr_init.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ static void init_heap(void)
4545
#define init_heap(...)
4646
#endif /* CONFIG_MBEDTLS_ENABLE_HEAP && MBEDTLS_MEMORY_BUFFER_ALLOC_C */
4747

48+
#if defined(CONFIG_MBEDTLS_ZEPHYR_ENTROPY)
4849
static const struct device *const entropy_dev =
4950
DEVICE_DT_GET_OR_NULL(DT_CHOSEN(zephyr_entropy));
5051

@@ -80,6 +81,7 @@ int mbedtls_hardware_poll(void *data, unsigned char *output, size_t len,
8081

8182
return 0;
8283
}
84+
#endif /* CONFIG_MBEDTLS_ZEPHYR_ENTROPY */
8385

8486
static int _mbedtls_init(const struct device *device)
8587
{

0 commit comments

Comments
 (0)