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>
This commit is contained in:
parent
1c1ec3c0b5
commit
6bb4b4bc35
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user