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

login
register
mail settings
Submitter Benoît Thébaudeau
Date Aug. 10, 2012, 6:59 p.m.
Message ID <1098314323.2282034.1344625152983.JavaMail.root@advansee.com>
Download mbox | patch
Permalink /patch/176597/
State Accepted
Commit 6bb4b4bc3554c87c342ecbe69fd4a79af7e32741
Delegated to: Andy Fleming
Headers show

Comments

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

Patch

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