summaryrefslogtreecommitdiff
path: root/common/cmd_mmc.c
diff options
context:
space:
mode:
authorStephen Warren <swarren@nvidia.com>2014-05-07 12:19:03 -0600
committerPantelis Antoniou <panto@antoniou-consulting.com>2014-05-23 12:23:28 +0300
commitdf348d8245922adbb03a3a979429c5e70342973c (patch)
tree87219904064264f42aa32a0d54b9b6f8cbcb7bfa /common/cmd_mmc.c
parentd235628434657cf1eba58821445cb5ad88e10763 (diff)
downloadu-boot-imx-df348d8245922adbb03a3a979429c5e70342973c.zip
u-boot-imx-df348d8245922adbb03a3a979429c5e70342973c.tar.gz
u-boot-imx-df348d8245922adbb03a3a979429c5e70342973c.tar.bz2
cmd_mmc: use new mmc_select_hwpart() function
The implementation of mmc_select_hwpart() was cribbed from do_mmcops(). Update do_mmcops() to call mmc_select_hwpart() to avoid duplication. <panto> Manual patch update due to patch order. Acked-by: Pantelis Antoniou <panto@antoniou-consulting.com> Signed-off-by: Stephen Warren <swarren@nvidia.com>
Diffstat (limited to 'common/cmd_mmc.c')
-rw-r--r--common/cmd_mmc.c21
1 files changed, 6 insertions, 15 deletions
diff --git a/common/cmd_mmc.c b/common/cmd_mmc.c
index 55af295..eea3375 100644
--- a/common/cmd_mmc.c
+++ b/common/cmd_mmc.c
@@ -403,7 +403,7 @@ static int do_mmc_part(cmd_tbl_t *cmdtp, int flag,
static int do_mmc_dev(cmd_tbl_t *cmdtp, int flag,
int argc, char * const argv[])
{
- int dev, part = -1;
+ int dev, part = -1, ret;
struct mmc *mmc;
if (argc == 1) {
@@ -427,20 +427,11 @@ static int do_mmc_dev(cmd_tbl_t *cmdtp, int flag,
return CMD_RET_FAILURE;
if (part != -1) {
- int ret;
- if (mmc->part_config == MMCPART_NOAVAILABLE) {
- printf("Card doesn't support part_switch\n");
- return CMD_RET_FAILURE;
- }
-
- if (part != mmc->part_num) {
- ret = mmc_switch_part(dev, part);
- if (!ret)
- mmc->part_num = part;
-
- printf("switch to partitions #%d, %s\n",
- part, (!ret) ? "OK" : "ERROR");
- }
+ ret = mmc_select_hwpart(dev, part);
+ printf("switch to partitions #%d, %s\n",
+ part, (!ret) ? "OK" : "ERROR");
+ if (ret)
+ return 1;
}
curr_device = dev;
if (mmc->part_config == MMCPART_NOAVAILABLE)