Skip to content

Commit 9a5b951

Browse files
galakd3zd3z
authored andcommitted
zephyr: convert DT_JEDEC_SPI_NOR_0_LABEL to new dt macros
As the DT define DT_JEDEC_SPI_NOR_0_LABEL is intended to be deprecated move to the new macro style to determine for DT_JEDEC_SPI_NOR_0_LABEL Signed-off-by: Kumar Gala <[email protected]>
1 parent 32b61f3 commit 9a5b951

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

boot/zephyr/include/target.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,15 @@
2525

2626
#endif /* !defined(MCUBOOT_TARGET_CONFIG) */
2727

28+
#if DT_NODE_HAS_PROP(DT_INST(0, jedec_spi_nor), label)
29+
#define JEDEC_SPI_NOR_0_LABEL DT_LABEL(DT_INST(0, jedec_spi_nor))
30+
#endif
31+
2832
/*
2933
* Sanity check the target support.
3034
*/
3135
#if (!defined(CONFIG_XTENSA) && !defined(DT_CHOSEN_ZEPHYR_FLASH_CONTROLLER_LABEL)) || \
32-
(defined(CONFIG_XTENSA) && !defined(DT_JEDEC_SPI_NOR_0_LABEL)) || \
36+
(defined(CONFIG_XTENSA) && !defined(JEDEC_SPI_NOR_0_LABEL)) || \
3337
!defined(FLASH_ALIGN) || \
3438
!defined(DT_FLASH_AREA_IMAGE_0_OFFSET) || \
3539
!defined(DT_FLASH_AREA_IMAGE_0_SIZE) || \

boot/zephyr/main.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -284,9 +284,9 @@ void main(void)
284284
while (1)
285285
;
286286
}
287-
#elif (defined(CONFIG_XTENSA) && defined(DT_JEDEC_SPI_NOR_0_LABEL))
288-
if (!flash_device_get_binding(DT_JEDEC_SPI_NOR_0_LABEL)) {
289-
BOOT_LOG_ERR("Flash device %s not found", DT_JEDEC_SPI_NOR_0_LABEL);
287+
#elif (defined(CONFIG_XTENSA) && defined(JEDEC_SPI_NOR_0_LABEL))
288+
if (!flash_device_get_binding(JEDEC_SPI_NOR_0_LABEL)) {
289+
BOOT_LOG_ERR("Flash device %s not found", JEDEC_SPI_NOR_0_LABEL);
290290
while (1)
291291
;
292292
}

0 commit comments

Comments
 (0)