summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorBrandon Maier <brandon.maier@collins.com>2022-12-12 12:01:57 -0600
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2023-05-30 11:12:12 +0200
commita527b22f0a30d66d4674624d16f4bb0ffe2e94d0 (patch)
tree6b1433247e68ac7a184d864704c6622b7c979760 /include
parentce791de8e9ded220f39fbfe4cc5a0bd93b1e985f (diff)
libmtd: Add function to get MTD info by device name
This is a convenience function for end users. In some situations it's easier to reference MTD device's by their name then by MTD number, as the name may be more reliable if device partitioning is dynamic or for porting between systems. Signed-off-by: Brandon Maier <brandon.maier@collins.com> Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'include')
-rw-r--r--include/libmtd.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/include/libmtd.h b/include/libmtd.h
index 6ab0de5..f909a16 100644
--- a/include/libmtd.h
+++ b/include/libmtd.h
@@ -130,7 +130,7 @@ int mtd_get_info(libmtd_t desc, struct mtd_info *info);
/**
* mtd_get_dev_info - get information about an MTD device.
* @desc: MTD library descriptor
- * @node: name of the MTD device node
+ * @node: path of the MTD device node
* @mtd: the MTD device information is returned here
*
* This function gets information about MTD device defined by the @node device
@@ -152,6 +152,17 @@ int mtd_get_dev_info(libmtd_t desc, const char *node, struct mtd_dev_info *mtd);
int mtd_get_dev_info1(libmtd_t desc, int mtd_num, struct mtd_dev_info *mtd);
/**
+ * mtd_get_dev_info2 - get information about an MTD device.
+ * @desc: MTD library descriptor
+ * @name: name of the MTD device
+ * @mtd: the MTD device information is returned here
+ *
+ * This function is identical to 'mtd_get_dev_info()' except that it accepts
+ * MTD device's name, not MTD character device.
+ */
+int mtd_get_dev_info2(libmtd_t desc, const char *name, struct mtd_dev_info *mtd);
+
+/**
* mtd_lock - lock eraseblocks.
* @desc: MTD library descriptor
* @mtd: MTD device description object