zephyr: remove deprecated DT_CHOSEN_ZEPHYR_FLASH_CONTROLLER_LABEL
DT_CHOSEN_ZEPHYR_FLASH_CONTROLLER_LABEL is going to be deprecated, so
remove its usages from the Zephyr port. Definition checks have been
replaced with DT_HAS_CHOSEN(zephyr_flash_controller), and the macro
itself has been replaced by
DT_LABEL(DT_CHOSEN(zephyr_flash_controller)). Note that the code could
likely be refactored to make use of compile time device references, ie
use DEVICE_DT_GET, but that task has been left for the maintainers.
Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
diff --git a/boot/zephyr/main.c b/boot/zephyr/main.c
index 0a0c874..09a6f40 100644
--- a/boot/zephyr/main.c
+++ b/boot/zephyr/main.c
@@ -18,6 +18,7 @@
#include <assert.h>
#include <zephyr.h>
+#include <devicetree.h>
#include <drivers/gpio.h>
#include <sys/__assert.h>
#include <drivers/flash.h>
@@ -455,10 +456,10 @@
(void)rc;
-#if (!defined(CONFIG_XTENSA) && defined(DT_CHOSEN_ZEPHYR_FLASH_CONTROLLER_LABEL))
- if (!flash_device_get_binding(DT_CHOSEN_ZEPHYR_FLASH_CONTROLLER_LABEL)) {
+#if (!defined(CONFIG_XTENSA) && DT_HAS_CHOSEN(zephyr_flash_controller))
+ if (!flash_device_get_binding(DT_LABEL(DT_CHOSEN(zephyr_flash_controller)))) {
BOOT_LOG_ERR("Flash device %s not found",
- DT_CHOSEN_ZEPHYR_FLASH_CONTROLLER_LABEL);
+ DT_LABEL(DT_CHOSEN(zephyr_flash_controller)));
while (1)
;
}