Skip to content

Commit 270c67d

Browse files
rruuaanngfabiobaltieri
authored andcommitted
fs: Add a FSTAB_ENTRY_DT_*_MOUNT_POINT macros
These macros provide a way to get the `mount-point` value from an fstab entry: - FSTAB_ENTRY_DT_MOUNT_POINT - FSTAB_ENTRY_DT_INST_MOUNT_POINT Signed-off-by: James Roy <[email protected]>
1 parent 9d10d67 commit 270c67d

File tree

1 file changed

+18
-0
lines changed
  • include/zephyr/fs

1 file changed

+18
-0
lines changed

include/zephyr/fs/fs.h

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,24 @@ struct fs_statvfs {
209209
| (DT_PROP(node_id, no_format) ? FS_MOUNT_FLAG_NO_FORMAT : 0) \
210210
| (DT_PROP(node_id, disk_access) ? FS_MOUNT_FLAG_USE_DISK_ACCESS : 0))
211211

212+
/**
213+
* @brief Get the mount-point from an fstab entry.
214+
*
215+
* @param node_id The node identifier for a child entry in a zephyr,fstab node.
216+
* @return The mount-point path.
217+
*/
218+
#define FSTAB_ENTRY_DT_MOUNT_POINT(node_id) \
219+
DT_PROP(node_id, mount_point)
220+
221+
/**
222+
* @brief Get the mount-point from an fstab entry.
223+
*
224+
* @param inst Instance number
225+
* @return The mount-point path.
226+
*/
227+
#define FSTAB_ENTRY_DT_INST_MOUNT_POINT(inst) \
228+
DT_INST_PROP(inst, mount_point)
229+
212230
/**
213231
* @brief The name under which a zephyr,fstab entry mount structure is
214232
* defined.

0 commit comments

Comments
 (0)