]> git.karo-electronics.de Git - karo-tx-uboot.git/blobdiff - drivers/core/root.c
dm: core: Set device tree node for root device
[karo-tx-uboot.git] / drivers / core / root.c
index 393dd98b9db248c2c5d8ef89d280d1568cb3d759..a5b0a615016fec116960b3bb2c12b6f00dd2f4b8 100644 (file)
@@ -49,6 +49,9 @@ int dm_init(void)
        ret = device_bind_by_name(NULL, false, &root_info, &DM_ROOT_NON_CONST);
        if (ret)
                return ret;
+#ifdef CONFIG_OF_CONTROL
+       DM_ROOT_NON_CONST->of_offset = 0;
+#endif
        ret = device_probe(DM_ROOT_NON_CONST);
        if (ret)
                return ret;
@@ -73,10 +76,8 @@ int dm_scan_platdata(bool pre_reloc_only)
                dm_warn("Some drivers were not found\n");
                ret = 0;
        }
-       if (ret)
-               return ret;
 
-       return 0;
+       return ret;
 }
 
 #ifdef CONFIG_OF_CONTROL
@@ -91,7 +92,7 @@ int dm_scan_fdt_node(struct udevice *parent, const void *blob, int offset,
                if (pre_reloc_only &&
                    !fdt_getprop(blob, offset, "u-boot,dm-pre-reloc", NULL))
                        continue;
-               err = lists_bind_fdt(parent, blob, offset);
+               err = lists_bind_fdt(parent, blob, offset, NULL);
                if (err && !ret)
                        ret = err;
        }