]> git.sur5r.net Git - u-boot/blobdiff - drivers/core/root.c
Merge branch 'master' of git://git.denx.de/u-boot-ubi
[u-boot] / drivers / core / root.c
index 393dd98b9db248c2c5d8ef89d280d1568cb3d759..73e3c7228e300e67da317098160d9c9c988446b3 100644 (file)
@@ -9,6 +9,7 @@
 
 #include <common.h>
 #include <errno.h>
+#include <fdtdec.h>
 #include <malloc.h>
 #include <libfdt.h>
 #include <dm/device.h>
@@ -49,6 +50,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 +77,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 +93,11 @@ 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);
+               if (!fdtdec_get_is_enabled(blob, offset)) {
+                       dm_dbg("   - ignoring disabled device\n");
+                       continue;
+               }
+               err = lists_bind_fdt(parent, blob, offset, NULL);
                if (err && !ret)
                        ret = err;
        }