summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorTom Rini <trini@ti.com>2014-06-12 09:02:23 -0400
committerTom Rini <trini@ti.com>2014-06-12 09:02:23 -0400
commitd8a97f934c64a7ba6f11da5e4cc7f3be57fcb82d (patch)
tree2892161319e812828594a2c9b6f93a1c752b212a /drivers
parent6736ec15c518d013263fa97fc48ca22a50753792 (diff)
parent3d6a5a4dfca25a202e356e4d63e89cdc6bd7255a (diff)
downloadu-boot-imx-d8a97f934c64a7ba6f11da5e4cc7f3be57fcb82d.zip
u-boot-imx-d8a97f934c64a7ba6f11da5e4cc7f3be57fcb82d.tar.gz
u-boot-imx-d8a97f934c64a7ba6f11da5e4cc7f3be57fcb82d.tar.bz2
Merge branch 'master' of git://git.denx.de/u-boot-mmc
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mmc/kona_sdhci.c8
-rw-r--r--drivers/mmc/mmc.c7
2 files changed, 10 insertions, 5 deletions
diff --git a/drivers/mmc/kona_sdhci.c b/drivers/mmc/kona_sdhci.c
index 77e42c8..f804f4c 100644
--- a/drivers/mmc/kona_sdhci.c
+++ b/drivers/mmc/kona_sdhci.c
@@ -113,16 +113,20 @@ int kona_sdhci_init(int dev_index, u32 min_clk, u32 quirks)
__func__, dev_index);
ret = -EINVAL;
}
- if (ret)
+ if (ret) {
+ free(host);
return ret;
+ }
host->name = "kona-sdhci";
host->ioaddr = reg_base;
host->quirks = quirks;
host->host_caps = MMC_MODE_HC;
- if (init_kona_mmc_core(host))
+ if (init_kona_mmc_core(host)) {
+ free(host);
return -EINVAL;
+ }
if (quirks & SDHCI_QUIRK_REG32_RW)
host->version = sdhci_readl(host, SDHCI_HOST_VERSION - 2) >> 16;
diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
index 55c2c68..b5477b1 100644
--- a/drivers/mmc/mmc.c
+++ b/drivers/mmc/mmc.c
@@ -10,6 +10,7 @@
#include <config.h>
#include <common.h>
#include <command.h>
+#include <errno.h>
#include <mmc.h>
#include <part.h>
#include <malloc.h>
@@ -564,19 +565,19 @@ int mmc_select_hwpart(int dev_num, int hwpart)
int ret;
if (!mmc)
- return -1;
+ return -ENODEV;
if (mmc->part_num == hwpart)
return 0;
if (mmc->part_config == MMCPART_NOAVAILABLE) {
printf("Card doesn't support part_switch\n");
- return -1;
+ return -EMEDIUMTYPE;
}
ret = mmc_switch_part(dev_num, hwpart);
if (ret)
- return -1;
+ return ret;
mmc->part_num = hwpart;