summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJoshua Watt <[email protected]>2023-07-03 08:39:54 -0500
committerTom Rini <[email protected]>2023-07-17 15:39:55 -0400
commit387f8be55b5091c4ed39221ef6a38ea7099d0a36 (patch)
tree90111de1210771b235dc8e98106a94125442157c /include
parent44ef2855e1ec5964c02cadd2cc3423f87524830b (diff)
disk: part: Add API to get partitions with specific driver
Adds part_driver_get_type() API which can be used to force a specific driver to be used when getting partition information instead of relying on auto detection. Signed-off-by: Joshua Watt <[email protected]> Reviewed-by: Simon Glass <[email protected]>
Diffstat (limited to 'include')
-rw-r--r--include/part.h19
1 files changed, 18 insertions, 1 deletions
diff --git a/include/part.h b/include/part.h
index 3b1b5398699..b19b33ab89a 100644
--- a/include/part.h
+++ b/include/part.h
@@ -105,7 +105,24 @@ struct blk_desc *blk_get_dev(const char *ifname, int dev);
struct blk_desc *mg_disk_get_dev(int dev);
-/* disk/part.c */
+/**
+ * part_get_info_by_type() - Get partitions from a block device using a specific
+ * partition driver
+ *
+ * Each interface allocates its own devices and typically struct blk_desc is
+ * contained with the interface's data structure. There is no global
+ * numbering for block devices, so the interface name must be provided.
+ *
+ * @dev_desc: Block device descriptor
+ * @part: Partition number to read
+ * @part_type: Partition driver to use, or PART_TYPE_UNKNOWN to automatically
+ * choose a driver
+ * @info: Returned partition information
+ *
+ * Return: 0 on success, negative errno on failure
+ */
+int part_get_info_by_type(struct blk_desc *dev_desc, int part, int part_type,
+ struct disk_partition *info);
int part_get_info(struct blk_desc *dev_desc, int part,
struct disk_partition *info);
/**