summaryrefslogtreecommitdiff
path: root/drivers/core
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/core')
-rw-r--r--drivers/core/uclass.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/core/uclass.c b/drivers/core/uclass.c
index 117d35ac49..3146dfd032 100644
--- a/drivers/core/uclass.c
+++ b/drivers/core/uclass.c
@@ -146,6 +146,9 @@ int uclass_get(enum uclass_id id, struct uclass **ucp)
{
struct uclass *uc;
+ /* Immediately fail if driver model is not set up */
+ if (!gd->uclass_root)
+ return -EDEADLK;
*ucp = NULL;
uc = uclass_find(id);
if (!uc) {