aboutsummaryrefslogtreecommitdiff
path: root/drivers/core
diff options
context:
space:
mode:
authorSimon Glass2021-03-15 17:25:16 +1300
committerSimon Glass2021-03-22 19:23:28 +1300
commit3fa9f553c0c0418b9abf93c2f33a44c98380beaf (patch)
treea9a8b64005dcee9706af7e1400852cd4765864af /drivers/core
parent1ef3af3b2717aba9db79879274ab5e1f1d7b2d25 (diff)
dm: core: Adjust uclass setup with of-platdata
When OF_PLATDATA_INST is enabled we don't need to create the uclass list. Instead we just need to point to the existing list. Update the code accordingly. Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/core')
-rw-r--r--drivers/core/root.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/core/root.c b/drivers/core/root.c
index 9bc682cffea..3feadb77b56 100644
--- a/drivers/core/root.c
+++ b/drivers/core/root.c
@@ -140,8 +140,12 @@ int dm_init(bool of_live)
dm_warn("Virtual root driver already exists!\n");
return -EINVAL;
}
- gd->uclass_root = &DM_UCLASS_ROOT_S_NON_CONST;
- INIT_LIST_HEAD(DM_UCLASS_ROOT_NON_CONST);
+ if (CONFIG_IS_ENABLED(OF_PLATDATA_INST)) {
+ gd->uclass_root = &uclass_head;
+ } else {
+ gd->uclass_root = &DM_UCLASS_ROOT_S_NON_CONST;
+ INIT_LIST_HEAD(DM_UCLASS_ROOT_NON_CONST);
+ }
if (IS_ENABLED(CONFIG_NEEDS_MANUAL_RELOC)) {
fix_drivers();