diff --git a/tests/subsys/llext/simple/src/test_llext_simple.c b/tests/subsys/llext/simple/src/test_llext_simple.c index 375dc3edb00e74..788c27ce2eb4b4 100644 --- a/tests/subsys/llext/simple/src/test_llext_simple.c +++ b/tests/subsys/llext/simple/src/test_llext_simple.c @@ -109,7 +109,7 @@ static void threads_objects_test_setup(struct llext *, struct k_thread *llext_th k_object_access_grant(&my_sem, llext_thread); k_object_access_grant(&my_thread, llext_thread); k_object_access_grant(&my_thread_stack, llext_thread); -#if DT_HAS_CHOSEN(zephyr_console) +#if DT_HAS_CHOSEN(zephyr_console) && DT_NODE_HAS_STATUS_OKAY(DT_CHOSEN(zephyr_console)) k_object_access_grant(DEVICE_DT_GET(DT_CHOSEN(zephyr_console)), llext_thread); #endif } diff --git a/tests/subsys/llext/simple/src/threads_kernel_objects_ext.c b/tests/subsys/llext/simple/src/threads_kernel_objects_ext.c index 89bdd3486e43e9..d5acaf52f62527 100644 --- a/tests/subsys/llext/simple/src/threads_kernel_objects_ext.c +++ b/tests/subsys/llext/simple/src/threads_kernel_objects_ext.c @@ -22,7 +22,7 @@ * Some platforms do not define any usable DT devices (not even the console). * In those cases the device API test can't be executed. */ -#if DT_HAS_CHOSEN(zephyr_console) +#if DT_HAS_CHOSEN(zephyr_console) && DT_NODE_HAS_STATUS_OKAY(DT_CHOSEN(zephyr_console)) #define CONSOLE_DT_NODE DT_CHOSEN(zephyr_console) #endif