From 88b6329cce9b344159ac7d708f8f2d6bfd98faf0 Mon Sep 17 00:00:00 2001 From: Alex Deymo Date: Sun, 2 Apr 2017 01:49:50 -0700 Subject: 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 Reviewed-by: Simon Glass --- include/part.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/part.h b/include/part.h index b6d1b33167b..83bce05a43d 100644 --- a/include/part.h +++ b/include/part.h @@ -163,7 +163,8 @@ int blk_get_device_part_str(const char *ifname, const char *dev_part_str, * @param gpt_name - the specified table entry name * @param info - returns the disk partition info * - * @return - '0' on match, '-1' on no match, otherwise error + * @return - the partition number on match (starting on 1), -1 on no match, + * otherwise error */ int part_get_info_by_name(struct blk_desc *dev_desc, const char *name, disk_partition_t *info); -- cgit v1.3.1