summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2023-07-16 06:38:47 +0300
committerBin Meng <bmeng@tinylab.org>2023-07-17 12:12:06 +0300
commit125194e6a136f2a3ef49d443f139b44a04e1bb9e (patch)
tree3c8948421454cfa9b2f1bfae919aa78fdc02ddfd /include
parentb279f5170a807a87a5726bcbeb0bc98937102eee (diff)
downloadu-boot-125194e6a136f2a3ef49d443f139b44a04e1bb9e.tar.xz
part: Allow setting the partition-table type
Some devices have multiple partition types available on the same media. It is sometimes useful to see these to check that everything is working correctly. Provide a way to manually set the partition-table type, avoiding the auto-detection process. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'include')
-rw-r--r--include/part.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/part.h b/include/part.h
index be75c73549..3b1b539869 100644
--- a/include/part.h
+++ b/include/part.h
@@ -598,6 +598,15 @@ static inline struct part_driver *part_driver_get_first(void)
return ll_entry_start(struct part_driver, part_driver);
}
+/**
+ * part_get_type_by_name() - Get partition type by name
+ *
+ * @name: Name of partition type to look up (not case-sensitive)
+ * Returns: Corresponding partition type (PART_TYPE_...) or PART_TYPE_UNKNOWN if
+ * not known
+ */
+int part_get_type_by_name(const char *name);
+
#else
static inline int part_driver_get_count(void)
{ return 0; }