aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2020-12-16 21:20:10 -0700
committerSimon Glass <sjg@chromium.org>2020-12-18 20:32:21 -0700
commit1c55b229232c87751fbe3d2b378b496352960816 (patch)
tree0bd00ba31e4205efd0066e74df449b407a0719e7
parentcd53e5bf4bba421d98eb42ec71af31b521a90c2a (diff)
downloadu-boot-1c55b229232c87751fbe3d2b378b496352960816.zip
u-boot-1c55b229232c87751fbe3d2b378b496352960816.tar.gz
u-boot-1c55b229232c87751fbe3d2b378b496352960816.tar.bz2
dm: test: Check all devices have a sequence numbers
Add a test that the new sequence numbers work as expected. Every device should get one. Signed-off-by: Simon Glass <sjg@chromium.org>
-rw-r--r--test/dm/core.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/dm/core.c b/test/dm/core.c
index 0e0696a..a7c0f40 100644
--- a/test/dm/core.c
+++ b/test/dm/core.c
@@ -1066,3 +1066,22 @@ static int dm_test_inactive_child(struct unit_test_state *uts)
return 0;
}
DM_TEST(dm_test_inactive_child, UT_TESTF_SCAN_PDATA);
+
+/* Make sure all bound devices have a sequence number */
+static int dm_test_all_have_seq(struct unit_test_state *uts)
+{
+ struct udevice *dev;
+ struct uclass *uc;
+
+ list_for_each_entry(uc, &gd->uclass_root, sibling_node) {
+ list_for_each_entry(dev, &uc->dev_head, uclass_node) {
+ if (dev->sqq == -1)
+ printf("Device '%s' has no seq (%d)\n",
+ dev->name, dev->sqq);
+ ut_assert(dev->sqq != -1);
+ }
+ }
+
+ return 0;
+}
+DM_TEST(dm_test_all_have_seq, UT_TESTF_SCAN_PDATA);