diff options
author | Sean Anderson | 2021-02-05 09:38:59 -0500 |
---|---|---|
committer | Marek Vasut | 2021-02-26 15:30:55 +0100 |
commit | ae5e6b4e8f91c4de7814c0308097b05c8e5358a1 (patch) | |
tree | aff273e234e1baf2946dfd216c01387fb2d814c7 /drivers/fastboot | |
parent | f3cf964f2d3588281342469b9bf722fea90daa0c (diff) |
fastboot: Move part_get_info_by_name_or_alias after raw_part_get_info_by_name
This makes the next commit more readable by doing the move now.
Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/fastboot')
-rw-r--r-- | drivers/fastboot/fb_mmc.c | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/drivers/fastboot/fb_mmc.c b/drivers/fastboot/fb_mmc.c index 75347bb99b5..71eeb02c8f1 100644 --- a/drivers/fastboot/fb_mmc.c +++ b/drivers/fastboot/fb_mmc.c @@ -28,28 +28,6 @@ struct fb_mmc_sparse { struct blk_desc *dev_desc; }; -static int part_get_info_by_name_or_alias(struct blk_desc *dev_desc, - const char *name, struct disk_partition *info) -{ - int ret; - - ret = part_get_info_by_name(dev_desc, name, info); - if (ret < 0) { - /* strlen("fastboot_partition_alias_") + PART_NAME_LEN + 1 */ - char env_alias_name[25 + PART_NAME_LEN + 1]; - char *aliased_part_name; - - /* check for alias */ - strcpy(env_alias_name, "fastboot_partition_alias_"); - strncat(env_alias_name, name, PART_NAME_LEN); - aliased_part_name = env_get(env_alias_name); - if (aliased_part_name != NULL) - ret = part_get_info_by_name(dev_desc, - aliased_part_name, info); - } - return ret; -} - static int raw_part_get_info_by_name(struct blk_desc *dev_desc, const char *name, struct disk_partition *info) @@ -98,6 +76,28 @@ static int raw_part_get_info_by_name(struct blk_desc *dev_desc, return 0; } +static int part_get_info_by_name_or_alias(struct blk_desc *dev_desc, + const char *name, struct disk_partition *info) +{ + int ret; + + ret = part_get_info_by_name(dev_desc, name, info); + if (ret < 0) { + /* strlen("fastboot_partition_alias_") + PART_NAME_LEN + 1 */ + char env_alias_name[25 + PART_NAME_LEN + 1]; + char *aliased_part_name; + + /* check for alias */ + strcpy(env_alias_name, "fastboot_partition_alias_"); + strncat(env_alias_name, name, PART_NAME_LEN); + aliased_part_name = env_get(env_alias_name); + if (aliased_part_name != NULL) + ret = part_get_info_by_name(dev_desc, + aliased_part_name, info); + } + return ret; +} + /** * fb_mmc_blk_write() - Write/erase MMC in chunks of FASTBOOT_MAX_BLK_WRITE * |