test: Move dm_scan_plat() to test_pre_run()
authorSimon Glass <sjg@chromium.org>
Mon, 8 Mar 2021 00:34:52 +0000 (17:34 -0700)
committerTom Rini <trini@konsulko.com>
Fri, 12 Mar 2021 14:57:29 +0000 (09:57 -0500)
Move this step over to the pre-run function.

Signed-off-by: Simon Glass <sjg@chromium.org>
test/dm/test-dm.c
test/test-main.c

index c2e1a1b9207b73da0cd8586fcb2fff07ab2926b8..18877c7ae56601723e43d56e24841a4f199f8e0c 100644 (file)
@@ -74,8 +74,6 @@ static int dm_do_test(struct unit_test_state *uts, struct unit_test *test,
        ut_assertok(dm_test_init(uts, of_live));
 
        uts->start = mallinfo();
-       if (test->flags & UT_TESTF_SCAN_PDATA)
-               ut_assertok(dm_scan_plat(false));
 
        ut_assertok(test_pre_run(uts, test));
 
index bd2f08a2b42a32091d26194b0bc22f9365ee7863..fe96d739dc417c3b842e2d4ed71a0297d1513c87 100644 (file)
@@ -34,6 +34,9 @@ int test_pre_run(struct unit_test_state *uts, struct unit_test *test)
        if (!(test->flags & UT_TESTF_DM))
                uts->start = mallinfo();
 
+       if (test->flags & UT_TESTF_SCAN_PDATA)
+               ut_assertok(dm_scan_plat(false));
+
        if (test->flags & UT_TESTF_PROBE_TEST)
                ut_assertok(do_autoprobe(uts));