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 --- disk/part.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'disk') diff --git a/disk/part.c b/disk/part.c index cd447024c0..491b02dc9c 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; } } } -- cgit v1.2.3