]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
mmc: call device_probe() after scanning
authorAKASHI Takahiro <takahiro.akashi@linaro.org>
Tue, 8 Mar 2022 11:36:41 +0000 (20:36 +0900)
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Sat, 9 Apr 2022 19:06:31 +0000 (21:06 +0200)
Every time a mmc bus/port is scanned and a new device is detected,
we want to call device_probe() as it will give us a chance to run
additional post-processings for some purposes.

In particular, support for creating partitions on a device will be added.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
drivers/mmc/mmc-uclass.c

index b80e838066ca70bd1b37282fbf378b145653e502..57da788ad80575b1eaebeac8b41436453e2a130e 100644 (file)
@@ -467,6 +467,18 @@ static int mmc_blk_probe(struct udevice *dev)
                return ret;
        }
 
+       ret = device_probe(dev);
+       if (ret) {
+               debug("Probing %s failed (err=%d)\n", dev->name, ret);
+
+               if (CONFIG_IS_ENABLED(MMC_UHS_SUPPORT) ||
+                   CONFIG_IS_ENABLED(MMC_HS200_SUPPORT) ||
+                   CONFIG_IS_ENABLED(MMC_HS400_SUPPORT))
+                       mmc_deinit(mmc);
+
+               return ret;
+       }
+
        return 0;
 }