From: Benoît Thébaudeau Date: Fri, 10 Aug 2012 08:59:12 +0000 (+0000) Subject: mmc_get_dev: Return error if mmc_init fails X-Git-Tag: v2012.10-rc1~44^2~7 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=6bb4b4bc3554c87c342ecbe69fd4a79af7e32741;p=u-boot mmc_get_dev: Return error if mmc_init fails Signed-off-by: Benoît Thébaudeau Cc: Andy Fleming Signed-off-by: Andy Fleming --- diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c index 64abe5b1c8..a60cfe1cb0 100644 --- a/drivers/mmc/mmc.c +++ b/drivers/mmc/mmc.c @@ -1286,10 +1286,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