]> git.sur5r.net Git - u-boot/blobdiff - drivers/core/simple-bus.c
sunxi: mmc: Fix phase delays
[u-boot] / drivers / core / simple-bus.c
index 1a9c864ef377e65334f0cf50a1e83e49be8675a2..5acfa5f0e492b558bcc77f4cd9c0ca30d27e5f55 100644 (file)
@@ -6,9 +6,6 @@
 
 #include <common.h>
 #include <dm.h>
-#include <dm/root.h>
-
-DECLARE_GLOBAL_DATA_PTR;
 
 struct simple_bus_plat {
        u32 base;
@@ -28,11 +25,13 @@ fdt_addr_t simple_bus_translate(struct udevice *dev, fdt_addr_t addr)
 
 static int simple_bus_post_bind(struct udevice *dev)
 {
+#if CONFIG_IS_ENABLED(OF_PLATDATA)
+       return 0;
+#else
        u32 cell[3];
        int ret;
 
-       ret = fdtdec_get_int_array(gd->fdt_blob, dev->of_offset, "ranges",
-                                  cell, ARRAY_SIZE(cell));
+       ret = dev_read_u32_array(dev, "ranges", cell, ARRAY_SIZE(cell));
        if (!ret) {
                struct simple_bus_plat *plat = dev_get_uclass_platdata(dev);
 
@@ -41,7 +40,8 @@ static int simple_bus_post_bind(struct udevice *dev)
                plat->size = cell[2];
        }
 
-       return dm_scan_fdt_node(dev, gd->fdt_blob, dev->of_offset, false);
+       return dm_scan_fdt_dev(dev);
+#endif
 }
 
 UCLASS_DRIVER(simple_bus) = {