dm: Provide a function to scan child FDT nodes
[oweals/u-boot.git] / drivers / core / uclass.c
index a27f3d50275277e4ab29fa0a33837d2645ce3033..61ca17e564a25dff143da7c26b8d886dab90de04 100644 (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