[U-Boot] [PATCH] mmc_get_dev: Return error if mmc_init fails

Benoît Thébaudeau benoit.thebaudeau at advansee.com
Fri Aug 10 20:59:12 CEST 2012


Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau at advansee.com>
Cc: Andy Fleming <afleming at gmail.com>
---
 .../drivers/mmc/mmc.c                              |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git u-boot-4d3c95f.orig/drivers/mmc/mmc.c u-boot-4d3c95f/drivers/mmc/mmc.c
index c1c2862..c0b969c 100644
--- u-boot-4d3c95f.orig/drivers/mmc/mmc.c
+++ u-boot-4d3c95f/drivers/mmc/mmc.c
@@ -1311,10 +1311,9 @@ int mmc_register(struct mmc *mmc)
 block_dev_desc_t *mmc_get_dev(int dev)
 {
 	struct mmc *mmc = find_mmc_device(dev);
-	if (!mmc)
+	if (!mmc || mmc_init(mmc))
 		return NULL;
 
-	mmc_init(mmc);
 	return &mmc->block_dev;
 }
 #endif


More information about the U-Boot mailing list