aboutsummaryrefslogtreecommitdiff
path: root/pylibfdt/libfdt.i
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2017-08-19 11:18:01 -0600
committerDavid Gibson <david@gibson.dropbear.id.au>2017-08-21 10:17:57 +1000
commit5bed86aee9e82cd8467560a9a39358943aaa4ad9 (patch)
tree40f5d7b228272c05b3be83107f6660ea8d6bfa0c /pylibfdt/libfdt.i
parent46f31b65b3b3b1c284027ac6c287c75df64c126d (diff)
downloaddtc-5bed86aee9e82cd8467560a9a39358943aaa4ad9.zip
dtc-5bed86aee9e82cd8467560a9a39358943aaa4ad9.tar.gz
dtc-5bed86aee9e82cd8467560a9a39358943aaa4ad9.tar.bz2
pylibfdt: Add support for fdt_subnode_offset()
Add this into the class to simplify use of this function. Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'pylibfdt/libfdt.i')
-rw-r--r--pylibfdt/libfdt.i17
1 files changed, 17 insertions, 0 deletions
diff --git a/pylibfdt/libfdt.i b/pylibfdt/libfdt.i
index d492d58..415820d 100644
--- a/pylibfdt/libfdt.i
+++ b/pylibfdt/libfdt.i
@@ -174,6 +174,23 @@ class Fdt:
self._fdt = bytearray(data)
check_err(fdt_check_header(self._fdt));
+ def subnode_offset(self, parentoffset, name, quiet=()):
+ """Get the offset of a named subnode
+
+ Args:
+ parentoffset: Offset of the parent node to check
+ name: Name of the required subnode, e.g. 'subnode@1'
+ quiet: Errors to ignore (empty to raise on all errors)
+
+ Returns:
+ The node offset of the found node, if any
+
+ Raises
+ FdtException if there is no node with that name, or other error
+ """
+ return check_err(fdt_subnode_offset(self._fdt, parentoffset, name),
+ quiet)
+
def path_offset(self, path, quiet=()):
"""Get the offset for a given path