€•)iŒsphinx.addnodes”Œdocument”“”)”}”(Œ rawsource”Œ”Œchildren”]”(Œ translations”Œ LanguagesNode”“”)”}”(hhh]”(hŒ pending_xref”“”)”}”(hhh]”Œdocutils.nodes”ŒText”“”ŒChinese (Simplified)”…””}”Œparent”hsbaŒ attributes”}”(Œids”]”Œclasses”]”Œnames”]”Œdupnames”]”Œbackrefs”]”Œ refdomain”Œstd”Œreftype”Œdoc”Œ reftarget”Œ*/translations/zh_CN/devicetree/of_unittest”Œmodname”NŒ classname”NŒ refexplicit”ˆuŒtagname”hhh ubh)”}”(hhh]”hŒChinese (Traditional)”…””}”hh2sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ*/translations/zh_TW/devicetree/of_unittest”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒItalian”…””}”hhFsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ*/translations/it_IT/devicetree/of_unittest”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒJapanese”…””}”hhZsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ*/translations/ja_JP/devicetree/of_unittest”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒKorean”…””}”hhnsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ*/translations/ko_KR/devicetree/of_unittest”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒPortuguese (Brazilian)”…””}”hh‚sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ*/translations/pt_BR/devicetree/of_unittest”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒSpanish”…””}”hh–sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ*/translations/sp_SP/devicetree/of_unittest”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubeh}”(h]”h ]”h"]”h$]”h&]”Œcurrent_language”ŒEnglish”uh1h hhŒ _document”hŒsource”NŒline”NubhŒcomment”“”)”}”(hŒ SPDX-License-Identifier: GPL-2.0”h]”hŒ SPDX-License-Identifier: GPL-2.0”…””}”hh·sbah}”(h]”h ]”h"]”h$]”h&]”Œ xml:space”Œpreserve”uh1hµhhh²hh³ŒD/var/lib/git/docbuild/linux/Documentation/devicetree/of_unittest.rst”h´KubhŒsection”“”)”}”(hhh]”(hŒtitle”“”)”}”(hŒ!Open Firmware Devicetree Unittest”h]”hŒ!Open Firmware Devicetree Unittest”…””}”(hhÏh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhhÊh²hh³hÇh´KubhŒ paragraph”“”)”}”(hŒ4Author: Gaurav Minocha ”h]”(hŒAuthor: Gaurav Minocha <”…””}”(hhßh²hh³Nh´NubhŒ reference”“”)”}”(hŒgaurav.minocha.os@gmail.com”h]”hŒgaurav.minocha.os@gmail.com”…””}”(hhéh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œrefuri”Œ"mailto:gaurav.minocha.os@gmail.com”uh1hçhhßubhŒ>”…””}”(hhßh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´KhhÊh²hubhÉ)”}”(hhh]”(hÎ)”}”(hŒ1. Introduction”h]”hŒ1. Introduction”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhjh²hh³hÇh´K ubhÞ)”}”(hŒ This document explains how the test data required for executing OF unittest is attached to the live tree dynamically, independent of the machine's architecture.”h]”hŒ¢This document explains how the test data required for executing OF unittest is attached to the live tree dynamically, independent of the machine’s architecture.”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K hjh²hubhÞ)”}”(hŒFIt is recommended to read the following documents before moving ahead.”h]”hŒFIt is recommended to read the following documents before moving ahead.”…””}”(hj"h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´Khjh²hubhŒenumerated_list”“”)”}”(hhh]”(hŒ list_item”“”)”}”(hŒ(Documentation/devicetree/usage-model.rst”h]”hÞ)”}”(hj9h]”hŒ(Documentation/devicetree/usage-model.rst”…””}”(hj;h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´Khj7ubah}”(h]”h ]”h"]”h$]”h&]”uh1j5hj2h²hh³hÇh´Nubj6)”}”(hŒ,http://www.devicetree.org/Device_Tree_Usage ”h]”hÞ)”}”(hŒ+http://www.devicetree.org/Device_Tree_Usage”h]”hè)”}”(hjTh]”hŒ+http://www.devicetree.org/Device_Tree_Usage”…””}”(hjVh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œrefuri”jTuh1hçhjRubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´KhjNubah}”(h]”h ]”h"]”h$]”h&]”uh1j5hj2h²hh³hÇh´Nubeh}”(h]”h ]”h"]”h$]”h&]”Œenumtype”Œarabic”Œprefix”Œ(”Œsuffix”Œ)”uh1j0hjh²hh³hÇh´KubhÞ)”}”(hXOF Selftest has been designed to test the interface (include/linux/of.h) provided to device driver developers to fetch the device information..etc. from the unflattened device tree data structure. This interface is used by most of the device drivers in various use cases.”h]”hXOF Selftest has been designed to test the interface (include/linux/of.h) provided to device driver developers to fetch the device information..etc. from the unflattened device tree data structure. This interface is used by most of the device drivers in various use cases.”…””}”(hj|h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´Khjh²hubeh}”(h]”Œ introduction”ah ]”h"]”Œ1. introduction”ah$]”h&]”uh1hÈhhÊh²hh³hÇh´K ubhÉ)”}”(hhh]”(hÎ)”}”(hŒ2. Verbose Output (EXPECT)”h]”hŒ2. Verbose Output (EXPECT)”…””}”(hj•h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhj’h²hh³hÇh´KubhÞ)”}”(hXuIf unittest detects a problem it will print a warning or error message to the console. Unittest also triggers warning and error messages from other kernel code as a result of intentionally bad unittest data. This has led to confusion as to whether the triggered messages are an expected result of a test or whether there is a real problem that is independent of unittest.”h]”hXuIf unittest detects a problem it will print a warning or error message to the console. Unittest also triggers warning and error messages from other kernel code as a result of intentionally bad unittest data. This has led to confusion as to whether the triggered messages are an expected result of a test or whether there is a real problem that is independent of unittest.”…””}”(hj£h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´Khj’h²hubhÞ)”}”(hX'EXPECT \ : text' (begin) and 'EXPECT / : text' (end) messages have been added to unittest to report that a warning or error is expected. The begin is printed before triggering the warning or error, and the end is printed after triggering the warning or error.”h]”hX ‘EXPECT : text’ (begin) and ‘EXPECT / : text’ (end) messages have been added to unittest to report that a warning or error is expected. The begin is printed before triggering the warning or error, and the end is printed after triggering the warning or error.”…””}”(hj±h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K$hj’h²hubhÞ)”}”(hXRThe EXPECT messages result in very noisy console messages that are difficult to read. The script scripts/dtc/of_unittest_expect was created to filter this verbosity and highlight mismatches between triggered warnings and errors vs expected warnings and errors. More information is available from 'scripts/dtc/of_unittest_expect --help'.”h]”hXVThe EXPECT messages result in very noisy console messages that are difficult to read. The script scripts/dtc/of_unittest_expect was created to filter this verbosity and highlight mismatches between triggered warnings and errors vs expected warnings and errors. More information is available from ‘scripts/dtc/of_unittest_expect --help’.”…””}”(hj¿h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K)hj’h²hubeh}”(h]”Œverbose-output-expect”ah ]”h"]”Œ2. verbose output (expect)”ah$]”h&]”uh1hÈhhÊh²hh³hÇh´KubhÉ)”}”(hhh]”(hÎ)”}”(hŒ 3. Test-data”h]”hŒ 3. Test-data”…””}”(hjØh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhjÕh²hh³hÇh´K1ubhÞ)”}”(hŒÆThe Device Tree Source file (drivers/of/unittest-data/testcases.dtso) contains the test data required for executing the unit tests automated in drivers/of/unittest.c. See the content of the folder::”h]”hŒÅThe Device Tree Source file (drivers/of/unittest-data/testcases.dtso) contains the test data required for executing the unit tests automated in drivers/of/unittest.c. See the content of the folder:”…””}”(hjæh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K3hjÕh²hubhŒ literal_block”“”)”}”(hŒ%drivers/of/unittest-data/tests-*.dtsi”h]”hŒ%drivers/of/unittest-data/tests-*.dtsi”…””}”hjösbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jôh³hÇh´K7hjÕh²hubhÞ)”}”(hŒLfor the Device Tree Source Include files (.dtsi) included in testcases.dtso.”h]”hŒLfor the Device Tree Source Include files (.dtsi) included in testcases.dtso.”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K9hjÕh²hubhÞ)”}”(hŒXWhen the kernel is built with CONFIG_OF_UNITTEST enabled, then the following make rule::”h]”hŒWWhen the kernel is built with CONFIG_OF_UNITTEST enabled, then the following make rule:”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K;hjÕh²hubjõ)”}”(hŒL$(obj)/%.dtbo: $(src)/%.dtso $(DTC) FORCE $(call if_changed_dep,dtc)”h]”hŒL$(obj)/%.dtbo: $(src)/%.dtso $(DTC) FORCE $(call if_changed_dep,dtc)”…””}”hj sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jôh³hÇh´K>hjÕh²hubhÞ)”}”(hŒzis used to compile the DT source file (testcases.dtso) into a binary blob (testcases.dtbo), also referred as flattened DT.”h]”hŒzis used to compile the DT source file (testcases.dtso) into a binary blob (testcases.dtbo), also referred as flattened DT.”…””}”(hj.h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´KAhjÕh²hubhÞ)”}”(hŒnAfter that, using the following rule the binary blob above is wrapped as an assembly file (testcases.dtbo.S)::”h]”hŒmAfter that, using the following rule the binary blob above is wrapped as an assembly file (testcases.dtbo.S):”…””}”(hj<h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´KDhjÕh²hubjõ)”}”(hŒJ$(obj)/%.dtbo.S: $(obj)/%.dtbo FORCE $(call if_changed,wrap_S_dtb)”h]”hŒJ$(obj)/%.dtbo.S: $(obj)/%.dtbo FORCE $(call if_changed,wrap_S_dtb)”…””}”hjJsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jôh³hÇh´KGhjÕh²hubhÞ)”}”(hŒjThe assembly file is compiled into an object file (testcases.dtbo.o), and is linked into the kernel image.”h]”hŒjThe assembly file is compiled into an object file (testcases.dtbo.o), and is linked into the kernel image.”…””}”(hjXh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´KJhjÕh²hubhÉ)”}”(hhh]”(hÎ)”}”(hŒ3.1. Adding the test data”h]”hŒ3.1. Adding the test data”…””}”(hjih²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhjfh²hh³hÇh´KOubhÞ)”}”(hŒ#Un-flattened device tree structure:”h]”hŒ#Un-flattened device tree structure:”…””}”(hjwh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´KQhjfh²hubhÞ)”}”(hŒkUn-flattened device tree consists of connected device_node(s) in form of a tree structure described below::”h]”hŒjUn-flattened device tree consists of connected device_node(s) in form of a tree structure described below:”…””}”(hj…h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´KShjfh²hubjõ)”}”(hŒÅ// following struct members are used to construct the tree struct device_node { ... struct device_node *parent; struct device_node *child; struct device_node *sibling; ... };”h]”hŒÅ// following struct members are used to construct the tree struct device_node { ... struct device_node *parent; struct device_node *child; struct device_node *sibling; ... };”…””}”hj“sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jôh³hÇh´KVhjfh²hubhÞ)”}”(hX¤Figure 1, describes a generic structure of machine's un-flattened device tree considering only child and sibling pointers. There exists another pointer, ``*parent``, that is used to traverse the tree in the reverse direction. So, at a particular level the child node and all the sibling nodes will have a parent pointer pointing to a common node (e.g. child1, sibling2, sibling3, sibling4's parent points to root node)::”h]”(hŒ›Figure 1, describes a generic structure of machine’s un-flattened device tree considering only child and sibling pointers. There exists another pointer, ”…””}”(hj¡h²hh³Nh´NubhŒliteral”“”)”}”(hŒ ``*parent``”h]”hŒ*parent”…””}”(hj«h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j©hj¡ubhX, that is used to traverse the tree in the reverse direction. So, at a particular level the child node and all the sibling nodes will have a parent pointer pointing to a common node (e.g. child1, sibling2, sibling3, sibling4’s parent points to root node):”…””}”(hj¡h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K_hjfh²hubjõ)”}”(hX¢root ('/') | child1 -> sibling2 -> sibling3 -> sibling4 -> null | | | | | | | null | | | | | child31 -> sibling32 -> null | | | | | | null null | | | child21 -> sibling22 -> sibling23 -> null | | | | | null null null | child11 -> sibling12 -> sibling13 -> sibling14 -> null | | | | | | | null | | | null null child131 -> null | null”h]”hX¢root ('/') | child1 -> sibling2 -> sibling3 -> sibling4 -> null | | | | | | | null | | | | | child31 -> sibling32 -> null | | | | | | null null | | | child21 -> sibling22 -> sibling23 -> null | | | | | null null null | child11 -> sibling12 -> sibling13 -> sibling14 -> null | | | | | | | null | | | null null child131 -> null | null”…””}”hjÃsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jôh³hÇh´Kfhjfh²hubhÞ)”}”(hŒ7Figure 1: Generic structure of un-flattened device tree”h]”hŒ7Figure 1: Generic structure of un-flattened device tree”…””}”(hjÑh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K|hjfh²hubhÞ)”}”(hXBefore executing OF unittest, it is required to attach the test data to machine's device tree (if present). So, when selftest_data_add() is called, at first it reads the flattened device tree data linked into the kernel image via the following kernel symbols::”h]”hXBefore executing OF unittest, it is required to attach the test data to machine’s device tree (if present). So, when selftest_data_add() is called, at first it reads the flattened device tree data linked into the kernel image via the following kernel symbols:”…””}”(hjßh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´Khjfh²hubjõ)”}”(hŒ…__dtb_testcases_begin - address marking the start of test data blob __dtb_testcases_end - address marking the end of test data blob”h]”hŒ…__dtb_testcases_begin - address marking the start of test data blob __dtb_testcases_end - address marking the end of test data blob”…””}”hjísbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jôh³hÇh´K„hjfh²hubhÞ)”}”(hXSecondly, it calls of_fdt_unflatten_tree() to unflatten the flattened blob. And finally, if the machine's device tree (i.e. live tree) is present, then it attaches the unflattened test data tree to the live tree, else it attaches itself as a live device tree.”h]”hXSecondly, it calls of_fdt_unflatten_tree() to unflatten the flattened blob. And finally, if the machine’s device tree (i.e. live tree) is present, then it attaches the unflattened test data tree to the live tree, else it attaches itself as a live device tree.”…””}”(hjûh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K‡hjfh²hubhÞ)”}”(hŒÞattach_node_and_children() uses of_attach_node() to attach the nodes into the live tree as explained below. To explain the same, the test data tree described in Figure 2 is attached to the live tree described in Figure 1::”h]”hŒÝattach_node_and_children() uses of_attach_node() to attach the nodes into the live tree as explained below. To explain the same, the test data tree described in Figure 2 is attached to the live tree described in Figure 1:”…””}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´KŒhjfh²hubjõ)”}”(hŒÜroot ('/') | testcase-data | test-child0 -> test-sibling1 -> test-sibling2 -> test-sibling3 -> null | | | | test-child01 null null null”h]”hŒÜroot ('/') | testcase-data | test-child0 -> test-sibling1 -> test-sibling2 -> test-sibling3 -> null | | | | test-child01 null null null”…””}”hjsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jôh³hÇh´Khjfh²hubhÞ)”}”(hŒ=Figure 2: Example test data tree to be attached to live tree.”h]”hŒ=Figure 2: Example test data tree to be attached to live tree.”…””}”(hj%h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K™hjfh²hubhÞ)”}”(hŒ»According to the scenario above, the live tree is already present so it isn't required to attach the root('/') node. All other nodes are attached by calling of_attach_node() on each node.”h]”hŒÁAccording to the scenario above, the live tree is already present so it isn’t required to attach the root(‘/’) node. All other nodes are attached by calling of_attach_node() on each node.”…””}”(hj3h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K›hjfh²hubhÞ)”}”(hXUIn the function of_attach_node(), the new node is attached as the child of the given parent in live tree. But, if parent already has a child then the new node replaces the current child and turns it into its sibling. So, when the testcase data node is attached to the live tree above (Figure 1), the final structure is as shown in Figure 3::”h]”hXTIn the function of_attach_node(), the new node is attached as the child of the given parent in live tree. But, if parent already has a child then the new node replaces the current child and turns it into its sibling. So, when the testcase data node is attached to the live tree above (Figure 1), the final structure is as shown in Figure 3:”…””}”(hjAh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´KŸhjfh²hubjõ)”}”(hX„root ('/') | testcase-data -> child1 -> sibling2 -> sibling3 -> sibling4 -> null | | | | | (...) | | | null | | child31 -> sibling32 -> null | | | | | | null null | | | child21 -> sibling22 -> sibling23 -> null | | | | | null null null | child11 -> sibling12 -> sibling13 -> sibling14 -> null | | | | null null | null | child131 -> null | null ----------------------------------------------------------------------- root ('/') | testcase-data -> child1 -> sibling2 -> sibling3 -> sibling4 -> null | | | | | | (...) (...) (...) null | test-sibling3 -> test-sibling2 -> test-sibling1 -> test-child0 -> null | | | | null null null test-child01”h]”hX„root ('/') | testcase-data -> child1 -> sibling2 -> sibling3 -> sibling4 -> null | | | | | (...) | | | null | | child31 -> sibling32 -> null | | | | | | null null | | | child21 -> sibling22 -> sibling23 -> null | | | | | null null null | child11 -> sibling12 -> sibling13 -> sibling14 -> null | | | | null null | null | child131 -> null | null ----------------------------------------------------------------------- root ('/') | testcase-data -> child1 -> sibling2 -> sibling3 -> sibling4 -> null | | | | | | (...) (...) (...) null | test-sibling3 -> test-sibling2 -> test-sibling1 -> test-child0 -> null | | | | null null null test-child01”…””}”hjOsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jôh³hÇh´K¥hjfh²hubhÞ)”}”(hŒGFigure 3: Live device tree structure after attaching the testcase-data.”h]”hŒGFigure 3: Live device tree structure after attaching the testcase-data.”…””}”(hj]h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´KÆhjfh²hubhÞ)”}”(hX3Astute readers would have noticed that test-child0 node becomes the last sibling compared to the earlier structure (Figure 2). After attaching first test-child0 the test-sibling1 is attached that pushes the child node (i.e. test-child0) to become a sibling and makes itself a child node, as mentioned above.”h]”hX3Astute readers would have noticed that test-child0 node becomes the last sibling compared to the earlier structure (Figure 2). After attaching first test-child0 the test-sibling1 is attached that pushes the child node (i.e. test-child0) to become a sibling and makes itself a child node, as mentioned above.”…””}”(hjkh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´KÉhjfh²hubhÞ)”}”(hŒøIf a duplicate node is found (i.e. if a node with same full_name property is already present in the live tree), then the node isn't attached rather its properties are updated to the live tree's node by calling the function update_node_properties().”h]”hŒüIf a duplicate node is found (i.e. if a node with same full_name property is already present in the live tree), then the node isn’t attached rather its properties are updated to the live tree’s node by calling the function update_node_properties().”…””}”(hjyh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´KÏhjfh²hubeh}”(h]”Œadding-the-test-data”ah ]”h"]”Œ3.1. adding the test data”ah$]”h&]”uh1hÈhjÕh²hh³hÇh´KOubhÉ)”}”(hhh]”(hÎ)”}”(hŒ3.2. Removing the test data”h]”hŒ3.2. Removing the test data”…””}”(hj’h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhjh²hh³hÇh´KÖubhÞ)”}”(hXuOnce the test case execution is complete, selftest_data_remove is called in order to remove the device nodes attached initially (first the leaf nodes are detached and then moving up the parent nodes are removed, and eventually the whole tree). selftest_data_remove() calls detach_node_and_children() that uses of_detach_node() to detach the nodes from the live device tree.”h]”hXuOnce the test case execution is complete, selftest_data_remove is called in order to remove the device nodes attached initially (first the leaf nodes are detached and then moving up the parent nodes are removed, and eventually the whole tree). selftest_data_remove() calls detach_node_and_children() that uses of_detach_node() to detach the nodes from the live device tree.”…””}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´KØhjh²hubhÞ)”}”(hŒÅTo detach a node, of_detach_node() either updates the child pointer of given node's parent to its sibling or attaches the previous sibling to the given node's sibling, as appropriate. That is it :)”h]”hŒÉTo detach a node, of_detach_node() either updates the child pointer of given node’s parent to its sibling or attaches the previous sibling to the given node’s sibling, as appropriate. That is it :)”…””}”(hj®h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´KÞhjh²hubeh}”(h]”Œremoving-the-test-data”ah ]”h"]”Œ3.2. removing the test data”ah$]”h&]”uh1hÈhjÕh²hh³hÇh´KÖubeh}”(h]”Œ test-data”ah ]”h"]”Œ 3. test-data”ah$]”h&]”uh1hÈhhÊh²hh³hÇh´K1ubeh}”(h]”Œ!open-firmware-devicetree-unittest”ah ]”h"]”Œ!open firmware devicetree unittest”ah$]”h&]”uh1hÈhhh²hh³hÇh´Kubeh}”(h]”h ]”h"]”h$]”h&]”Œsource”hÇuh1hŒcurrent_source”NŒ current_line”NŒsettings”Œdocutils.frontend”ŒValues”“”)”}”(hÍNŒ generator”NŒ datestamp”NŒ source_link”NŒ source_url”NŒ toc_backlinks”Œentry”Œfootnote_backlinks”KŒ sectnum_xform”KŒstrip_comments”NŒstrip_elements_with_classes”NŒ strip_classes”NŒ report_level”KŒ halt_level”KŒexit_status_level”KŒdebug”NŒwarning_stream”NŒ traceback”ˆŒinput_encoding”Œ utf-8-sig”Œinput_encoding_error_handler”Œstrict”Œoutput_encoding”Œutf-8”Œoutput_encoding_error_handler”j÷Œerror_encoding”Œutf-8”Œerror_encoding_error_handler”Œbackslashreplace”Œ language_code”Œen”Œrecord_dependencies”NŒconfig”NŒ id_prefix”hŒauto_id_prefix”Œid”Œ dump_settings”NŒdump_internals”NŒdump_transforms”NŒdump_pseudo_xml”NŒexpose_internals”NŒstrict_visitor”NŒ_disable_config”NŒ_source”hÇŒ _destination”NŒ _config_files”]”Œ7/var/lib/git/docbuild/linux/Documentation/docutils.conf”aŒfile_insertion_enabled”ˆŒ raw_enabled”KŒline_length_limit”M'Œpep_references”NŒ pep_base_url”Œhttps://peps.python.org/”Œpep_file_url_template”Œpep-%04d”Œrfc_references”NŒ rfc_base_url”Œ&https://datatracker.ietf.org/doc/html/”Œ tab_width”KŒtrim_footnote_reference_space”‰Œsyntax_highlight”Œlong”Œ smart_quotes”ˆŒsmartquotes_locales”]”Œcharacter_level_inline_markup”‰Œdoctitle_xform”‰Œ docinfo_xform”KŒsectsubtitle_xform”‰Œ image_loading”Œlink”Œembed_stylesheet”‰Œcloak_email_addresses”ˆŒsection_self_link”‰Œenv”NubŒreporter”NŒindirect_targets”]”Œsubstitution_defs”}”Œsubstitution_names”}”Œrefnames”}”Œrefids”}”Œnameids”}”(jÑjÎjjŒjÒjÏjÉjÆjŒj‰jÁj¾uŒ nametypes”}”(jщj‰jÒ‰jɉjŒ‰jÁ‰uh}”(jÎhÊjŒjjÏj’jÆjÕj‰jfj¾juŒ footnote_refs”}”Œ citation_refs”}”Œ autofootnotes”]”Œautofootnote_refs”]”Œsymbol_footnotes”]”Œsymbol_footnote_refs”]”Œ footnotes”]”Œ citations”]”Œautofootnote_start”KŒsymbol_footnote_start”KŒ id_counter”Œ collections”ŒCounter”“”}”…”R”Œparse_messages”]”Œtransform_messages”]”Œ transformer”NŒ include_log”]”Œ decoration”Nh²hub.