summaryrefslogtreecommitdiff
path: root/common/fb_mmc.c
diff options
context:
space:
mode:
authorAlex Deymo <deymo@google.com>2017-04-02 08:49:50 (GMT)
committerTom Rini <trini@konsulko.com>2017-05-12 02:03:37 (GMT)
commit88b6329cce9b344159ac7d708f8f2d6bfd98faf0 (patch)
tree467c895e20a1943197b9b186c7cb7f1d9b1bd6d2 /common/fb_mmc.c
parent210a7176ee11b6af6746ba7ca025f5b9afbcb003 (diff)
downloadu-boot-fsl-qoriq-88b6329cce9b344159ac7d708f8f2d6bfd98faf0.tar.xz
disk: Return the partition number in part_get_info_by_name()
Similar to what blk_get_device_part_str() does, this patch makes part_get_info_by_name() return the partition number in case of a match. This is useful when the partition number is needed and not just the descriptor. Signed-off-by: Alex Deymo <deymo@google.com> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'common/fb_mmc.c')
-rw-r--r--common/fb_mmc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/common/fb_mmc.c b/common/fb_mmc.c
index 6cc113d..866982e 100644
--- a/common/fb_mmc.c
+++ b/common/fb_mmc.c
@@ -37,7 +37,7 @@ static int part_get_info_by_name_or_alias(struct blk_desc *dev_desc,
int ret;
ret = part_get_info_by_name(dev_desc, name, info);
- if (ret) {
+ if (ret < 0) {
/* strlen("fastboot_partition_alias_") + 32(part_name) + 1 */
char env_alias_name[25 + 32 + 1];
char *aliased_part_name;
@@ -153,7 +153,7 @@ void fb_mmc_flash_write(const char *cmd, void *download_buffer,
}
#endif
- if (part_get_info_by_name_or_alias(dev_desc, cmd, &info)) {
+ if (part_get_info_by_name_or_alias(dev_desc, cmd, &info) < 0) {
error("cannot find partition: '%s'\n", cmd);
fastboot_fail("cannot find partition");
return;
@@ -205,7 +205,7 @@ void fb_mmc_erase(const char *cmd)
}
ret = part_get_info_by_name_or_alias(dev_desc, cmd, &info);
- if (ret) {
+ if (ret < 0) {
error("cannot find partition: '%s'", cmd);
fastboot_fail("cannot find partition");
return;