1
0
mirror of https://xff.cz/git/u-boot/ synced 2025-10-26 16:13:55 +01:00

dm: Avoid accessing uclasses before they are ready

Don't allow access to uclasses before they have been initialised.

Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Simon Glass
2014-07-23 06:55:15 -06:00
parent f4cdead24a
commit c910e2e2da
3 changed files with 18 additions and 1 deletions

View File

@@ -23,6 +23,8 @@ struct uclass *uclass_find(enum uclass_id key)
{
struct uclass *uc;
if (!gd->dm_root)
return NULL;
/*
* TODO(sjg@chromium.org): Optimise this, perhaps moving the found
* node to the start of the list, or creating a linear array mapping