€•hŒ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Œ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”…””}”(hhòhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¹hhïhž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 hhïhž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.”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h KhhïhžhubhŒenumerated_list”“”)”}”(hhh]”(hŒ list_item”“”)”}”(hŒ(Documentation/devicetree/usage-model.rst”h]”hÊ)”}”(hj%h]”hŒ(Documentation/devicetree/usage-model.rst”…””}”(hj'hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h Khj#ubah}”(h]”h ]”h"]”h$]”h&]”uh1j!hjhžhhŸh³h Nubj")”}”(hŒ,http://www.devicetree.org/Device_Tree_Usage ”h]”hÊ)”}”(hŒ+http://www.devicetree.org/Device_Tree_Usage”h]”hÔ)”}”(hj@h]”hŒ+http://www.devicetree.org/Device_Tree_Usage”…””}”(hjBhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”Œrefuri”j@uh1hÓhj>ubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h Khj:ubah}”(h]”h ]”h"]”h$]”h&]”uh1j!hjhžhhŸh³h Nubeh}”(h]”h ]”h"]”h$]”h&]”Œenumtype”Œarabic”Œprefix”Œ(”Œsuffix”Œ)”uh1jhhïhž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.”…””}”(hjhhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h Khhïhž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)”…””}”(hjhž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.”…””}”(hjhž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.”…””}”(hjhž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.dts) 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.dts) 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ŒKfor the Device Tree Source Include files (.dtsi) included in testcases.dts.”h]”hŒKfor the Device Tree Source Include files (.dtsi) included in testcases.dts.”…””}”(hjðhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h K9hjÁhžhubhÊ)”}”(hŒXWhen the kernel is build with CONFIG_OF_UNITTEST enabled, then the following make rule::”h]”hŒWWhen the kernel is build with CONFIG_OF_UNITTEST enabled, then the following make rule:”…””}”(hjþhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h K;hjÁhžhubjá)”}”(hŒD$(obj)/%.dtb: $(src)/%.dts FORCE $(call if_changed_dep, dtc)”h]”hŒD$(obj)/%.dtb: $(src)/%.dts FORCE $(call if_changed_dep, dtc)”…””}”hj sbah}”(h]”h ]”h"]”h$]”h&]”h±h²uh1jàhŸh³h K>hjÁhžhubhÊ)”}”(hŒxis used to compile the DT source file (testcases.dts) into a binary blob (testcases.dtb), also referred as flattened DT.”h]”hŒxis used to compile the DT source file (testcases.dts) into a binary blob (testcases.dtb), also referred as flattened DT.”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h KAhjÁhžhubhÊ)”}”(hŒmAfter that, using the following rule the binary blob above is wrapped as an assembly file (testcases.dtb.S)::”h]”hŒlAfter that, using the following rule the binary blob above is wrapped as an assembly file (testcases.dtb.S):”…””}”(hj(hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h KDhjÁhžhubjá)”}”(hŒ:$(obj)/%.dtb.S: $(obj)/%.dtb $(call cmd, dt_S_dtb)”h]”hŒ:$(obj)/%.dtb.S: $(obj)/%.dtb $(call cmd, dt_S_dtb)”…””}”hj6sbah}”(h]”h ]”h"]”h$]”h&]”h±h²uh1jàhŸh³h KGhjÁhžhubhÊ)”}”(hŒiThe assembly file is compiled into an object file (testcases.dtb.o), and is linked into the kernel image.”h]”hŒiThe assembly file is compiled into an object file (testcases.dtb.o), and is linked into the kernel image.”…””}”(hjDhž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”…””}”(hjUhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¹hjRhžhhŸh³h KOubhÊ)”}”(hŒ#Un-flattened device tree structure:”h]”hŒ#Un-flattened device tree structure:”…””}”(hjchžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h KQhjRhž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:”…””}”(hjqhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h KShjRhž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; ... };”…””}”hjsbah}”(h]”h ]”h"]”h$]”h&]”h±h²uh1jàhŸh³h KVhjRhž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, ”…””}”(hjhžhhŸNh NubhŒliteral”“”)”}”(hŒ ``*parent``”h]”hŒ*parent”…””}”(hj—hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j•hjubhX, 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):”…””}”(hjhžhhŸNh Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h K_hjRhž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 KfhjRhž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|hjRhž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 KhjRhž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„hjRhž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‡hjRhž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ŒhjRhž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 KhjRhž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.”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h K™hjRhž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.”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h K›hjRhž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:”…””}”(hj-hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h KŸhjRhž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”…””}”hj;sbah}”(h]”h ]”h"]”h$]”h&]”h±h²uh1jàhŸh³h K¥hjRhž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.”…””}”(hjIhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h KÆhjRhž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.”…””}”(hjWhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h KÉhjRhž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().”…””}”(hjehžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h KÏhjRhž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¹hj{hž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Øhj{hž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Þhj{hž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ºj{jxj¾j»jµj²jxjuj­jªuŒ nametypes”}”(j½‰j{‰j¾‰jµ‰jx‰j­‰uh}”(jºh¶jxhïj»j~j²jÁjujRjªj{uŒ 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.