dts: Bring in Chrome OS keyboard device tree definition
[oweals/u-boot.git] / drivers / core / uclass.c
index a27f3d50275277e4ab29fa0a33837d2645ce3033..901b06ed2baaf5f4b0cbdb71d3ca40170de33991 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
@@ -58,10 +60,6 @@ static int uclass_add(enum uclass_id id, struct uclass **ucp)
                        id);
                return -ENOENT;
        }
-       if (uc_drv->ops) {
-               dm_warn("No ops for uclass id %d\n", id);
-               return -EINVAL;
-       }
        uc = calloc(1, sizeof(*uc));
        if (!uc)
                return -ENOMEM;