blk: Switch over to using uclass IDs
We currently have an if_type (interface type) and a uclass id. These are closely related and we don't need to have both. Drop the if_type values and use the uclass ones instead. Maintain the existing, subtle, one-way conversion between UCLASS_USB and UCLASS_MASS_STORAGE for now, and add a comment. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
@@ -331,13 +331,13 @@ static int do_mmcrpmb(struct cmd_tbl *cmdtp, int flag,
|
||||
#else
|
||||
original_part = mmc_get_blk_desc(mmc)->hwpart;
|
||||
#endif
|
||||
if (blk_select_hwpart_devnum(IF_TYPE_MMC, curr_device, MMC_PART_RPMB) !=
|
||||
if (blk_select_hwpart_devnum(UCLASS_MMC, curr_device, MMC_PART_RPMB) !=
|
||||
0)
|
||||
return CMD_RET_FAILURE;
|
||||
ret = cp->cmd(cmdtp, flag, argc, argv);
|
||||
|
||||
/* Return to original partition */
|
||||
if (blk_select_hwpart_devnum(IF_TYPE_MMC, curr_device, original_part) !=
|
||||
if (blk_select_hwpart_devnum(UCLASS_MMC, curr_device, original_part) !=
|
||||
0)
|
||||
return CMD_RET_FAILURE;
|
||||
return ret;
|
||||
@@ -530,7 +530,7 @@ static int do_mmc_part(struct cmd_tbl *cmdtp, int flag,
|
||||
if (!mmc)
|
||||
return CMD_RET_FAILURE;
|
||||
|
||||
mmc_dev = blk_get_devnum_by_type(IF_TYPE_MMC, curr_device);
|
||||
mmc_dev = blk_get_devnum_by_type(UCLASS_MMC, curr_device);
|
||||
if (mmc_dev != NULL && mmc_dev->type != DEV_TYPE_UNKNOWN) {
|
||||
part_print(mmc_dev);
|
||||
return CMD_RET_SUCCESS;
|
||||
@@ -580,7 +580,7 @@ static int do_mmc_dev(struct cmd_tbl *cmdtp, int flag,
|
||||
if (!mmc)
|
||||
return CMD_RET_FAILURE;
|
||||
|
||||
ret = blk_select_hwpart_devnum(IF_TYPE_MMC, dev, part);
|
||||
ret = blk_select_hwpart_devnum(UCLASS_MMC, dev, part);
|
||||
printf("switch to partitions #%d, %s\n",
|
||||
part, (!ret) ? "OK" : "ERROR");
|
||||
if (ret)
|
||||
|
||||
Reference in New Issue
Block a user