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>
This commit is contained in:
@@ -33,7 +33,7 @@ struct uclass *uclass_find(enum uclass_id key)
|
||||
* node to the start of the list, or creating a linear array mapping
|
||||
* id to node.
|
||||
*/
|
||||
list_for_each_entry(uc, &gd->uclass_root, sibling_node) {
|
||||
list_for_each_entry(uc, gd->uclass_root, sibling_node) {
|
||||
if (uc->uc_drv->id == key)
|
||||
return uc;
|
||||
}
|
||||
@@ -84,7 +84,7 @@ static int uclass_add(enum uclass_id id, struct uclass **ucp)
|
||||
uc->uc_drv = uc_drv;
|
||||
INIT_LIST_HEAD(&uc->sibling_node);
|
||||
INIT_LIST_HEAD(&uc->dev_head);
|
||||
list_add(&uc->sibling_node, &DM_UCLASS_ROOT_NON_CONST);
|
||||
list_add(&uc->sibling_node, DM_UCLASS_ROOT_NON_CONST);
|
||||
|
||||
if (uc_drv->init) {
|
||||
ret = uc_drv->init(uc);
|
||||
|
||||
Reference in New Issue
Block a user