mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-28 07:31:15 +00:00
dm: test: Avoid destroying uclasses with of-platdata-inst
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 <sjg@chromium.org> Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
910de1092f
commit
e8c023c3f9
1 changed files with 18 additions and 10 deletions
|
@ -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;
|
||||
/*
|
||||
* With of-platdata-inst the uclasses are created at 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));
|
||||
/*
|
||||
* 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;
|
||||
|
|
Loading…
Reference in a new issue