soc: nordic: Fix validation of base addresses

Use `DT_REG_HAS_IDX()` instead of `DT_NODE_EXISTS()` when checking
if for a given nodelabel the base address of the associated node
should be validated, so that the validation is performed only if
the base address is available. This prevents build failures in cases
like the os_mgmt_datetime test where the `rtc` nodelabel is used for
an emulated RTC.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
This commit is contained in:
Andrzej Głąbek 2024-03-14 08:43:49 +01:00 committed by Maureen Helm
commit dde7c47e6a

View file

@ -90,7 +90,7 @@
*/ */
#define CHECK_DT_REG(lbl, mdk_addr) \ #define CHECK_DT_REG(lbl, mdk_addr) \
BUILD_ASSERT( \ BUILD_ASSERT( \
UTIL_OR(UTIL_NOT(DT_NODE_EXISTS(DT_NODELABEL(lbl))), \ UTIL_OR(UTIL_NOT(DT_REG_HAS_IDX(DT_NODELABEL(lbl), 0)), \
(DT_REG_ADDR(DT_NODELABEL(lbl)) == (uint32_t)(mdk_addr)))) (DT_REG_ADDR(DT_NODELABEL(lbl)) == (uint32_t)(mdk_addr))))
/** /**