From mboxrd@z Thu Jan 1 00:00:00 1970 From: Simon Glass Date: Wed, 3 Feb 2021 09:43:26 -0700 Subject: [PATCH v2 10/37] dm: test: Avoid destroying uclasses with of-platdata-inst In-Reply-To: <20210203164353.2577985-1-sjg@chromium.org> References: <20210203164353.2577985-1-sjg@chromium.org> Message-ID: <20210203164353.2577985-3-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 It is not possible to destroy the uclasses when they are created at build time. Skip this step so that SPL test can complete successfully. Signed-off-by: Simon Glass --- Changes in v2: - Update to deal with test refactoring series test/test-main.c | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/test/test-main.c b/test/test-main.c index e1b49e091ab..46a0c2ee2f6 100644 --- a/test/test-main.c +++ b/test/test-main.c @@ -62,17 +62,25 @@ static int dm_test_post_run(struct unit_test_state *uts) { int id; - for (id = 0; id < UCLASS_COUNT; id++) { - struct uclass *uc; - - /* - * If the uclass doesn't exist we don't want to create it. So - * check that here before we call uclass_find_device(). - */ - uc = uclass_find(id); - if (!uc) - continue; - ut_assertok(uclass_destroy(uc)); + /* + * With of-platdata-inst the uclasses are created@build time. If we + * destroy them we cannot get them back since uclass_add() is not + * supported. So skip this. + */ + if (!CONFIG_IS_ENABLED(OF_PLATDATA_INST)) { + for (id = 0; id < UCLASS_COUNT; id++) { + struct uclass *uc; + + /* + * If the uclass doesn't exist we don't want to create + * it. So check that here before we call + * uclass_find_device(). + */ + uc = uclass_find(id); + if (!uc) + continue; + ut_assertok(uclass_destroy(uc)); + } } return 0; -- 2.30.0.365.g02bc693789-goog