From: Simon Glass Date: Thu, 10 Dec 2020 18:31:30 -0700 Subject: [PATCH v2 05/26] dm: test: Check all devices have a sequence numbers In-Reply-To: <20201211013151.1927814-1-sjg@chromium.org> References: <20201211013151.1927814-1-sjg@chromium.org> Message-ID: <20201211013151.1927814-4-sjg@chromium.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Add a test that the new sequence numbers work as expected. Every device should get one. Signed-off-by: Simon Glass --- Changes in v2: - Drop the GD_FLG_DM_NO_SEQ flag test/dm/core.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/test/dm/core.c b/test/dm/core.c index 71ebb36d88b..0514813b817 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); -- 2.29.2.576.ga3fc446d84-goog