mirror of
https://github.com/dgibson/dtc.git
synced 2025-10-13 16:27:39 -04:00
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>
This commit is contained in:
parent
a3ae437236
commit
46f31b65b3
2 changed files with 24 additions and 0 deletions
|
@ -308,5 +308,15 @@ class PyLibfdtTests(unittest.TestCase):
|
|||
node2 = self.fdt.path_offset('/subnode@2/subsubnode@0')
|
||||
self.assertEquals(node1, self.fdt.parent_offset(node2))
|
||||
|
||||
def testNodeOffsetByPhandle(self):
|
||||
"""Test for the node_offset_by_phandle() method"""
|
||||
self.assertEquals(-libfdt.NOTFOUND,
|
||||
self.fdt.node_offset_by_phandle(1, QUIET_NOTFOUND))
|
||||
node1 = self.fdt.path_offset('/subnode@2')
|
||||
self.assertEquals(node1, self.fdt.node_offset_by_phandle(0x2000))
|
||||
node2 = self.fdt.path_offset('/subnode@2/subsubnode@0')
|
||||
self.assertEquals(node2, self.fdt.node_offset_by_phandle(0x2001))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue