mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-19 13:41:31 +00:00
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>
This commit is contained in:
parent
d235628434
commit
df348d8245
1 changed files with 6 additions and 15 deletions
|
@ -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,
|
static int do_mmc_dev(cmd_tbl_t *cmdtp, int flag,
|
||||||
int argc, char * const argv[])
|
int argc, char * const argv[])
|
||||||
{
|
{
|
||||||
int dev, part = -1;
|
int dev, part = -1, ret;
|
||||||
struct mmc *mmc;
|
struct mmc *mmc;
|
||||||
|
|
||||||
if (argc == 1) {
|
if (argc == 1) {
|
||||||
|
@ -427,20 +427,11 @@ static int do_mmc_dev(cmd_tbl_t *cmdtp, int flag,
|
||||||
return CMD_RET_FAILURE;
|
return CMD_RET_FAILURE;
|
||||||
|
|
||||||
if (part != -1) {
|
if (part != -1) {
|
||||||
int ret;
|
ret = mmc_select_hwpart(dev, part);
|
||||||
if (mmc->part_config == MMCPART_NOAVAILABLE) {
|
printf("switch to partitions #%d, %s\n",
|
||||||
printf("Card doesn't support part_switch\n");
|
part, (!ret) ? "OK" : "ERROR");
|
||||||
return CMD_RET_FAILURE;
|
if (ret)
|
||||||
}
|
return 1;
|
||||||
|
|
||||||
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");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
curr_device = dev;
|
curr_device = dev;
|
||||||
if (mmc->part_config == MMCPART_NOAVAILABLE)
|
if (mmc->part_config == MMCPART_NOAVAILABLE)
|
||||||
|
|
Loading…
Add table
Reference in a new issue