summaryrefslogtreecommitdiff
path: root/drivers/core/root.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2020-12-19 20:40:17 +0300
committerSimon Glass <sjg@chromium.org>2021-01-05 22:24:41 +0300
commit8a715530bb1f9522030757379415b174f3109951 (patch)
tree91422fb39012c35377fe8a50c772fb79634aba07 /drivers/core/root.c
parent49bbe6eab5babbc353f1dc76e6275671c69dffb2 (diff)
downloadu-boot-8a715530bb1f9522030757379415b174f3109951.tar.xz
dm: core: Allow the uclass list to move
At present the uclass list head is in global_data. This is convenient but with the new of-platdata we need the list head to be declared by the generated code. Change this over to be a pointer. Provide a 'static' version in global_data to retain the current behaviour. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/core/root.c')
-rw-r--r--drivers/core/root.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/core/root.c b/drivers/core/root.c
index 2a5ebec27d..3adbc94eb9 100644
--- a/drivers/core/root.c
+++ b/drivers/core/root.c
@@ -45,8 +45,8 @@ void dm_fixup_for_gd_move(struct global_data *new_gd)
{
/* The sentinel node has moved, so update things that point to it */
if (gd->dm_root) {
- new_gd->uclass_root.next->prev = &new_gd->uclass_root;
- new_gd->uclass_root.prev->next = &new_gd->uclass_root;
+ new_gd->uclass_root->next->prev = new_gd->uclass_root;
+ new_gd->uclass_root->prev->next = new_gd->uclass_root;
}
}
@@ -136,7 +136,8 @@ int dm_init(bool of_live)
dm_warn("Virtual root driver already exists!\n");
return -EINVAL;
}
- INIT_LIST_HEAD(&DM_UCLASS_ROOT_NON_CONST);
+ 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();