diff options
| author | Simon Glass <sjg@chromium.org> | 2023-01-17 10:47:23 -0700 |
|---|---|---|
| committer | Tom Rini <trini@konsulko.com> | 2023-01-23 18:11:39 -0500 |
| commit | ecb274cf06b79c791509e43af53d5a2ff1112941 (patch) | |
| tree | 27c90e872b54257090d8f952dc278b158ded3685 /test/test-main.c | |
| parent | d94d9844bca9352b1e9888a70f12c79ec76cd313 (diff) | |
dm: test: Correct ordering of DM setup
We must call dm_scan_other() after devices from the device tree have been
created, since that function behaves differently if there is no bootstd
device.
Adjust the logic to achieve this.
Also fix the bootflow_system() test which was relying on this broken
behaviour.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'test/test-main.c')
| -rw-r--r-- | test/test-main.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/test/test-main.c b/test/test-main.c index 9ab090b7b33..72aa3a0aa8f 100644 --- a/test/test-main.c +++ b/test/test-main.c @@ -296,10 +296,8 @@ static int test_pre_run(struct unit_test_state *uts, struct unit_test *test) uts->start = mallinfo(); - if (test->flags & UT_TESTF_SCAN_PDATA) { + if (test->flags & UT_TESTF_SCAN_PDATA) ut_assertok(dm_scan_plat(false)); - ut_assertok(dm_scan_other(false)); - } if (test->flags & UT_TESTF_PROBE_TEST) ut_assertok(do_autoprobe(uts)); @@ -308,6 +306,13 @@ static int test_pre_run(struct unit_test_state *uts, struct unit_test *test) (test->flags & UT_TESTF_SCAN_FDT)) ut_assertok(dm_extended_scan(false)); + /* + * Do this after FDT scan since dm_scan_other() in bootstd-uclass.c + * checks for the existence of bootstd + */ + if (test->flags & UT_TESTF_SCAN_PDATA) + ut_assertok(dm_scan_other(false)); + if (IS_ENABLED(CONFIG_SANDBOX) && (test->flags & UT_TESTF_OTHER_FDT)) { /* make sure the other FDT is available */ ut_assertok(test_load_other_fdt(uts)); |
