[U-Boot] [PATCH] spl_mmc: always use find_mmc_device() to get mmc handler

Kever Yang kever.yang at rock-chips.com
Thu Jul 25 09:40:21 UTC 2019


Like cmd/mmc.c, the spl_mmc.c are using block driver interface
like blk_dread() to access mmc devices, we need to get the mmc device
handler by block driver interface so that we can always get correct
device number, eg. the alias may change the device number which make
the device number different in UCLASS_MMC list and UCLASS_BLK list.

Signed-off-by: Kever Yang <kever.yang at rock-chips.com>
---

 common/spl/spl_mmc.c | 9 ---------
 1 file changed, 9 deletions(-)

diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c
index b3619889f7..3a93e20f04 100644
--- a/common/spl/spl_mmc.c
+++ b/common/spl/spl_mmc.c
@@ -113,9 +113,6 @@ static int spl_mmc_get_device_index(u32 boot_device)
 
 static int spl_mmc_find_device(struct mmc **mmcp, u32 boot_device)
 {
-#if CONFIG_IS_ENABLED(DM_MMC)
-	struct udevice *dev;
-#endif
 	int err, mmc_dev;
 
 	mmc_dev = spl_mmc_get_device_index(boot_device);
@@ -130,14 +127,8 @@ static int spl_mmc_find_device(struct mmc **mmcp, u32 boot_device)
 		return err;
 	}
 
-#if CONFIG_IS_ENABLED(DM_MMC)
-	err = uclass_get_device(UCLASS_MMC, mmc_dev, &dev);
-	if (!err)
-		*mmcp = mmc_get_mmc_dev(dev);
-#else
 	*mmcp = find_mmc_device(mmc_dev);
 	err = *mmcp ? 0 : -ENODEV;
-#endif
 	if (err) {
 #ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
 		printf("spl: could not find mmc device %d. error: %d\n",
-- 
2.17.1



More information about the U-Boot mailing list