mirror of
https://xff.cz/git/u-boot/
synced 2025-09-02 09:12:08 +02:00
dtoc: Fix Fdt.GetNode() to handle a missing node
At present the algortihm is not correct since it will return the root node if the requested node is not found and there are no slashes in the requested node name. Fix this and add a test. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
@@ -205,6 +205,9 @@ class TestProp(unittest.TestCase):
|
||||
self.node = self.dtb.GetNode('/spl-test')
|
||||
self.fdt = self.dtb.GetFdtObj()
|
||||
|
||||
def testMissingNode(self):
|
||||
self.assertEqual(None, self.dtb.GetNode('missing'))
|
||||
|
||||
def testPhandle(self):
|
||||
dtb = fdt.FdtScan('tools/dtoc/dtoc_test_phandle.dts')
|
||||
node = dtb.GetNode('/phandle-source')
|
||||
|
Reference in New Issue
Block a user