diff options
author | Simon Glass <sjg@chromium.org> | 2017-08-19 11:17:57 -0600 |
---|---|---|
committer | David Gibson <david@gibson.dropbear.id.au> | 2017-08-21 10:00:44 +1000 |
commit | a198af80344cb4ffc480dc2673ee2935ea618f1d (patch) | |
tree | 21b705c86c80479f700433a9202f61c88e33b4ca /pylibfdt | |
parent | b9eba92ea50f4444a49eab87942411f1f83df92a (diff) | |
download | device-tree-compiler-a198af80344cb4ffc480dc2673ee2935ea618f1d.tar.gz |
pylibfdt: Add support for fdt_get_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.i | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/pylibfdt/libfdt.i b/pylibfdt/libfdt.i index c7b79ec..0731202 100644 --- a/pylibfdt/libfdt.i +++ b/pylibfdt/libfdt.i @@ -348,6 +348,18 @@ class Fdt: return pdata return bytearray(pdata[0]) + def get_phandle(self, nodeoffset): + """Get the phandle of a node + + Args: + nodeoffset: Node offset to check + + Returns: + phandle of node, or 0 if the node has no phandle or another error + occurs + """ + return fdt_get_phandle(self._fdt, nodeoffset) + class Property: """Holds a device tree property name and value. |