]> git.sur5r.net Git - u-boot/blobdiff - drivers/mmc/mmc.c
Merge branch 'master' of git://git.denx.de/u-boot-video
[u-boot] / drivers / mmc / mmc.c
index e6028d503f279ee6617b29e9657d1c8a17e39a85..ede5d6eeec73e6fa2a6b6f38a8cd150a58d400e7 100644 (file)
@@ -1780,18 +1780,28 @@ static int mmc_probe(bd_t *bis)
 #elif defined(CONFIG_DM_MMC)
 static int mmc_probe(bd_t *bis)
 {
-       int ret;
+       int ret, i;
        struct uclass *uc;
-       struct udevice *m;
+       struct udevice *dev;
 
        ret = uclass_get(UCLASS_MMC, &uc);
        if (ret)
                return ret;
 
-       uclass_foreach_dev(m, uc) {
-               ret = device_probe(m);
+       /*
+        * Try to add them in sequence order. Really with driver model we
+        * should allow holes, but the current MMC list does not allow that.
+        * So if we request 0, 1, 3 we will get 0, 1, 2.
+        */
+       for (i = 0; ; i++) {
+               ret = uclass_get_device_by_seq(UCLASS_MMC, i, &dev);
+               if (ret == -ENODEV)
+                       break;
+       }
+       uclass_foreach_dev(dev, uc) {
+               ret = device_probe(dev);
                if (ret)
-                       printf("%s - probe failed: %d\n", m->name, ret);
+                       printf("%s - probe failed: %d\n", dev->name, ret);
        }
 
        return 0;