summaryrefslogtreecommitdiff
path: root/include/part.h
diff options
context:
space:
mode:
authorSam Protsenko <semen.protsenko@linaro.org>2017-09-22 01:51:58 +0300
committerTom Rini <trini@konsulko.com>2017-10-06 11:28:17 -0400
commit30789095566a6f4c62430f613f450acf8d5162e5 (patch)
tree638ea729a038272db9e29915b866168b5653ad9c /include/part.h
parent19d141a0f90c640a8d5ed699745cbc8169918945 (diff)
downloadu-boot-30789095566a6f4c62430f613f450acf8d5162e5.tar.gz
disk: Provide API to get partition by name for specific type
There is already existing function part_get_info_by_name(). But sometimes user is particularly interested in looking for only specific partition type. This patch implements such an API that provides partition searching by name for specified partition type. Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/part.h')
-rw-r--r--include/part.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/part.h b/include/part.h
index b2e820ef8a..0caceafc5f 100644
--- a/include/part.h
+++ b/include/part.h
@@ -174,6 +174,21 @@ int blk_get_device_part_str(const char *ifname, const char *dev_part_str,
disk_partition_t *info, int allow_whole_dev);
/**
+ * part_get_info_by_name_type() - Search for a partition by name
+ * for only specified partition type
+ *
+ * @param dev_desc - block device descriptor
+ * @param gpt_name - the specified table entry name
+ * @param info - returns the disk partition info
+ * @param part_type - only search in partitions of this type
+ *
+ * @return - the partition number on match (starting on 1), -1 on no match,
+ * otherwise error
+ */
+int part_get_info_by_name_type(struct blk_desc *dev_desc, const char *name,
+ disk_partition_t *info, int part_type);
+
+/**
* part_get_info_by_name() - Search for a partition by name
* among all available registered partitions
*