modules: mbedtls: Provide mbedtls_hardware_poll() conditionally

This is a follow-up to commit c7327f5f70.

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 <andrzej.glabek@nordicsemi.no>
This commit is contained in:
Andrzej Głąbek 2022-10-18 09:12:26 +02:00 committed by Stephanos Ioannidis
commit 010730aff6

View file

@ -45,6 +45,7 @@ static void init_heap(void)
#define init_heap(...)
#endif /* CONFIG_MBEDTLS_ENABLE_HEAP && MBEDTLS_MEMORY_BUFFER_ALLOC_C */
#if defined(CONFIG_MBEDTLS_ZEPHYR_ENTROPY)
static const struct device *const entropy_dev =
DEVICE_DT_GET_OR_NULL(DT_CHOSEN(zephyr_entropy));
@ -80,6 +81,7 @@ int mbedtls_hardware_poll(void *data, unsigned char *output, size_t len,
return 0;
}
#endif /* CONFIG_MBEDTLS_ZEPHYR_ENTROPY */
static int _mbedtls_init(const struct device *device)
{