diff --git a/core/kernel/dt_driver.c b/core/kernel/dt_driver.c index 25d666f3971..a65ab366ddf 100644 --- a/core/kernel/dt_driver.c +++ b/core/kernel/dt_driver.c @@ -677,12 +677,10 @@ static TEE_Result probe_dt_drivers_early(void) TEE_Result res = TEE_ERROR_GENERIC; const void *fdt = NULL; - if (!IS_ENABLED(CFG_EMBED_DTB)) + fdt = get_dt(); + if (!fdt) return TEE_SUCCESS; - fdt = get_embedded_dt(); - assert(fdt); - parse_node(fdt, fdt_path_offset(fdt, "/")); res = process_probe_list(fdt); @@ -700,12 +698,10 @@ static TEE_Result probe_dt_drivers(void) TEE_Result res = TEE_ERROR_GENERIC; const void *fdt = NULL; - if (!IS_ENABLED(CFG_EMBED_DTB)) + fdt = get_dt(); + if (!fdt) return TEE_SUCCESS; - fdt = get_embedded_dt(); - assert(fdt); - res = process_probe_list(fdt); if (res || !TAILQ_EMPTY(&dt_driver_failed_list)) { EMSG("Probe sequence result: %#"PRIx32, res); @@ -726,13 +722,12 @@ static TEE_Result release_probe_lists(void) struct dt_driver_probe *next = NULL; struct dt_driver_provider *prov = NULL; struct dt_driver_provider *next_prov = NULL; - const void * __maybe_unused fdt = NULL; + const void *fdt = NULL; - if (!IS_ENABLED(CFG_EMBED_DTB)) + fdt = get_dt(); + if (!fdt) return TEE_SUCCESS; - fdt = get_embedded_dt(); - assert(fdt && TAILQ_EMPTY(&dt_driver_probe_list)); TAILQ_FOREACH_SAFE(elt, &dt_driver_ready_list, link, next)