aboutsummaryrefslogtreecommitdiff
path: root/disk
diff options
context:
space:
mode:
authorAlex Deymo <deymo@google.com>2017-04-02 01:49:50 -0700
committerTom Rini <trini@konsulko.com>2017-05-11 22:03:37 -0400
commit88b6329cce9b344159ac7d708f8f2d6bfd98faf0 (patch)
tree467c895e20a1943197b9b186c7cb7f1d9b1bd6d2 /disk
parent210a7176ee11b6af6746ba7ca025f5b9afbcb003 (diff)
downloadu-boot-88b6329cce9b344159ac7d708f8f2d6bfd98faf0.zip
u-boot-88b6329cce9b344159ac7d708f8f2d6bfd98faf0.tar.gz
u-boot-88b6329cce9b344159ac7d708f8f2d6bfd98faf0.tar.bz2
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 'disk')
-rw-r--r--disk/part.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/disk/part.c b/disk/part.c
index cd44702..491b02d 100644
--- a/disk/part.c
+++ b/disk/part.c
@@ -635,7 +635,7 @@ int part_get_info_by_name(struct blk_desc *dev_desc, const char *name,
}
if (strcmp(name, (const char *)info->name) == 0) {
/* matched */
- return 0;
+ return i;
}
}
}