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-Url: http://git.lede-project.org./?a=commitdiff_plain;h=6bb4b4bc3554c87c342ecbe69fd4a79af7e32741;p=project%2Fbcm63xx%2Fu-boot.git 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