aboutsummaryrefslogtreecommitdiff
path: root/pylibfdt
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2017-08-19 11:17:59 -0600
committerDavid Gibson <david@gibson.dropbear.id.au>2017-08-21 10:00:44 +1000
commit46f31b65b3b3b1c284027ac6c287c75df64c126d (patch)
tree60d6de98fc21cd70a22d1078c9e406b191216552 /pylibfdt
parenta3ae43723687cd9e14e8e6c95c01152887ba94ac (diff)
downloaddtc-46f31b65b3b3b1c284027ac6c287c75df64c126d.zip
dtc-46f31b65b3b3b1c284027ac6c287c75df64c126d.tar.gz
dtc-46f31b65b3b3b1c284027ac6c287c75df64c126d.tar.bz2
pylibfdt: Add support for fdt_node_offset_by_phandle()
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')
-rw-r--r--pylibfdt/libfdt.i14
1 files changed, 14 insertions, 0 deletions
diff --git a/pylibfdt/libfdt.i b/pylibfdt/libfdt.i
index 5a1eba5..d492d58 100644
--- a/pylibfdt/libfdt.i
+++ b/pylibfdt/libfdt.i
@@ -375,6 +375,20 @@ class Fdt:
"""
return check_err(fdt_parent_offset(self._fdt, nodeoffset), quiet)
+ def node_offset_by_phandle(self, phandle, quiet=()):
+ """Get the offset of a node with the given phandle
+
+ Args:
+ phandle: Phandle to search for
+ quiet: Errors to ignore (empty to raise on all errors)
+
+ Returns:
+ The offset of node with that phandle, if any
+
+ Raises:
+ FdtException if no node found or other error occurs
+ """
+ return check_err(fdt_node_offset_by_phandle(self._fdt, phandle), quiet)
class Property:
"""Holds a device tree property name and value.