diff options
author | Peter Hurley <peter@hurleysoftware.com> | 2015-03-06 10:12:38 -0500 |
---|---|---|
committer | David Gibson <david@gibson.dropbear.id.au> | 2015-04-07 14:11:47 +1000 |
commit | b4150b59aef3f2353a64ae27601339a1b42541db (patch) | |
tree | 000bb847f29a1184ef6a393d17972b63b4e1bc14 /libfdt/libfdt.h | |
parent | a4b093f7366fdb429ca1781144d3985fa50d0fbb (diff) | |
download | dtc-b4150b59aef3f2353a64ae27601339a1b42541db.zip dtc-b4150b59aef3f2353a64ae27601339a1b42541db.tar.gz dtc-b4150b59aef3f2353a64ae27601339a1b42541db.tar.bz2 |
libfdt: Add fdt_path_offset_namelen()
Properties may contain path names which are not NUL-terminated.
For example, the 'stdout-path' property allows the form 'path:options',
where the ':' character terminates the path specifier.
Allow these path names to be used in-place for path descending;
add fdt_path_offset_namelen(), which limits the path name to 'namelen'
characters.
Reimplement fdt_path_offset() as a trivial wrapper.
Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Diffstat (limited to 'libfdt/libfdt.h')
-rw-r--r-- | libfdt/libfdt.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/libfdt/libfdt.h b/libfdt/libfdt.h index 32d5227..1054512 100644 --- a/libfdt/libfdt.h +++ b/libfdt/libfdt.h @@ -323,6 +323,17 @@ int fdt_subnode_offset_namelen(const void *fdt, int parentoffset, int fdt_subnode_offset(const void *fdt, int parentoffset, const char *name); /** + * fdt_path_offset_namelen - find a tree node by its full path + * @fdt: pointer to the device tree blob + * @path: full path of the node to locate + * @namelen: number of characters of path to consider + * + * Identical to fdt_path_offset(), but only consider the first namelen + * characters of path as the path name. + */ +int fdt_path_offset_namelen(const void *fdt, const char *path, int namelen); + +/** * fdt_path_offset - find a tree node by its full path * @fdt: pointer to the device tree blob * @path: full path of the node to locate |