Skip to content

Commit a3ee337

Browse files
committed
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 31ef45e commit a3ee337

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
@@ -206,6 +206,24 @@ struct fs_statvfs {
206206
| (DT_PROP(node_id, no_format) ? FS_MOUNT_FLAG_NO_FORMAT : 0) \
207207
| (DT_PROP(node_id, disk_access) ? FS_MOUNT_FLAG_USE_DISK_ACCESS : 0))
208208

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

0 commit comments

Comments
 (0)