summaryrefslogtreecommitdiff
path: root/drivers/mmc
diff options
context:
space:
mode:
authorBenoît Thébaudeau <benoit.thebaudeau@advansee.com>2012-08-10 08:59:12 +0000
committerAndy Fleming <afleming@freescale.com>2012-09-05 17:32:42 -0500
commit6bb4b4bc3554c87c342ecbe69fd4a79af7e32741 (patch)
treeb38e4757ce227ce6722083671b9577ad7457a07d /drivers/mmc
parent1c1ec3c0b599e3759f5e232a46f5460221941097 (diff)
downloadu-boot-imx-6bb4b4bc3554c87c342ecbe69fd4a79af7e32741.zip
u-boot-imx-6bb4b4bc3554c87c342ecbe69fd4a79af7e32741.tar.gz
u-boot-imx-6bb4b4bc3554c87c342ecbe69fd4a79af7e32741.tar.bz2
mmc_get_dev: Return error if mmc_init fails
Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com> Cc: Andy Fleming <afleming@gmail.com> Signed-off-by: Andy Fleming <afleming@freescale.com>
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/mmc.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
index 64abe5b..a60cfe1 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