zephyr: io: include 'bootutil_log.h' and declare log module membership
This fixes below error when building with 'MCUBOOT_INDICATION_LED' and
'LOG' enabled:
In file included from zephyr/include/zephyr/logging/log.h:11,
from zephyr/include/zephyr/usb/usb_device.h:43,
from bootloader/mcuboot/boot/zephyr/io.c:26:
mcuboot/boot/zephyr/io.c: In function 'io_led_init':
zephyr/include/zephyr/logging/log_core.h:151:20: error:
'__log_level' undeclared (first use in this function)
151 | (_level <= __log_level) && \
| ^~~~~~~~~~~
Fixes: 433b8480 ("zephyr: Move IO functions out of main to separate file")
Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
diff --git a/boot/zephyr/io.c b/boot/zephyr/io.c
index fc1966d..e6d54d3 100644
--- a/boot/zephyr/io.c
+++ b/boot/zephyr/io.c
@@ -28,6 +28,7 @@
#include <zephyr/linker/linker-defs.h>
#include "target.h"
+#include "bootutil/bootutil_log.h"
#if defined(CONFIG_BOOT_SERIAL_PIN_RESET) || defined(CONFIG_BOOT_FIRMWARE_LOADER_PIN_RESET)
#include <zephyr/drivers/hwinfo.h>
@@ -78,6 +79,8 @@
#error "Unsupported board: led0 devicetree alias is not defined"
#endif
+BOOT_LOG_MODULE_DECLARE(mcuboot);
+
void io_led_init(void)
{
if (!device_is_ready(led0.port)) {