diff options
author | Simon Glass <sjg@chromium.org> | 2021-03-07 17:34:57 -0700 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2021-03-12 09:57:30 -0500 |
commit | 4a467c6de6765a9685d1e3ced95ce141a14dfcf3 (patch) | |
tree | 9a6bc1cf452761b933013192ee8eb638cfe98ece /test/dm/test-dm.c | |
parent | 72b524cf426697e764c9c63611d0f6743f50f0f5 (diff) | |
download | u-boot-4a467c6de6765a9685d1e3ced95ce141a14dfcf3.tar.gz |
test: Drop struct dm_test_state
Driver model is a core part of U-Boot. We don't really need to have a
separate test structure for the driver model tests and it makes it harder
to write a test if you have to think about which type of test it is.
Subsume the fields from struct dm_test_state into struct unit_test_state
and delete the former.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'test/dm/test-dm.c')
-rw-r--r-- | test/dm/test-dm.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/test/dm/test-dm.c b/test/dm/test-dm.c index ceeac3fd361..15adc53f533 100644 --- a/test/dm/test-dm.c +++ b/test/dm/test-dm.c @@ -22,14 +22,15 @@ DECLARE_GLOBAL_DATA_PTR; struct unit_test_state global_dm_test_state; -static struct dm_test_state _global_priv_dm_test_state; int dm_test_init(struct unit_test_state *uts) { - struct dm_test_state *dms = uts->priv; bool of_live = uts->of_live; - memset(dms, '\0', sizeof(*dms)); + uts->root = NULL; + uts->testdev = NULL; + uts->force_fail_alloc = false; + uts->skip_post_probe = false; gd->dm_root = NULL; if (!CONFIG_IS_ENABLED(OF_PLATDATA)) memset(dm_testdrv_op_count, '\0', sizeof(dm_testdrv_op_count)); @@ -38,7 +39,7 @@ int dm_test_init(struct unit_test_state *uts) /* Determine whether to make the live tree available */ gd_set_of_root(of_live ? uts->of_root : NULL); ut_assertok(dm_init(of_live)); - dms->root = dm_root(); + uts->root = dm_root(); return 0; } @@ -124,7 +125,6 @@ int dm_test_run(const char *test_name) struct unit_test *test; int found; - uts->priv = &_global_priv_dm_test_state; uts->fail_count = 0; if (!CONFIG_IS_ENABLED(OF_PLATDATA)) { |