aboutsummaryrefslogtreecommitdiff
path: root/pylibfdt/libfdt.i
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2017-08-19 11:17:58 -0600
committerDavid Gibson <david@gibson.dropbear.id.au>2017-08-21 10:00:44 +1000
commita3ae43723687cd9e14e8e6c95c01152887ba94ac (patch)
treee500129239c4588d1fa791063df80192fa1cdc5d /pylibfdt/libfdt.i
parenta198af80344cb4ffc480dc2673ee2935ea618f1d (diff)
downloaddtc-a3ae43723687cd9e14e8e6c95c01152887ba94ac.zip
dtc-a3ae43723687cd9e14e8e6c95c01152887ba94ac.tar.gz
dtc-a3ae43723687cd9e14e8e6c95c01152887ba94ac.tar.bz2
pylibfdt: Add support for fdt_parent_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.i15
1 files changed, 15 insertions, 0 deletions
diff --git a/pylibfdt/libfdt.i b/pylibfdt/libfdt.i
index 0731202..5a1eba5 100644
--- a/pylibfdt/libfdt.i
+++ b/pylibfdt/libfdt.i
@@ -360,6 +360,21 @@ class Fdt:
"""
return fdt_get_phandle(self._fdt, nodeoffset)
+ def parent_offset(self, nodeoffset, quiet=()):
+ """Get the offset of a node's parent
+
+ Args:
+ nodeoffset: Node offset to check
+ quiet: Errors to ignore (empty to raise on all errors)
+
+ Returns:
+ The offset of the parent node, if any
+
+ Raises:
+ FdtException if no parent found or other error occurs
+ """
+ return check_err(fdt_parent_offset(self._fdt, nodeoffset), quiet)
+
class Property:
"""Holds a device tree property name and value.