Lines Matching refs:np
82 struct device_node *np; in of_unittest_find_node_by_name() local
85 np = of_find_node_by_path("/testcase-data"); in of_unittest_find_node_by_name()
86 name = kasprintf(GFP_KERNEL, "%pOF", np); in of_unittest_find_node_by_name()
87 unittest(np && name && !strcmp("/testcase-data", name), in of_unittest_find_node_by_name()
89 of_node_put(np); in of_unittest_find_node_by_name()
93 np = of_find_node_by_path("/testcase-data/"); in of_unittest_find_node_by_name()
94 unittest(!np, "trailing '/' on /testcase-data/ should fail\n"); in of_unittest_find_node_by_name()
96 np = of_find_node_by_path("/testcase-data/phandle-tests/consumer-a"); in of_unittest_find_node_by_name()
97 name = kasprintf(GFP_KERNEL, "%pOF", np); in of_unittest_find_node_by_name()
98 unittest(np && name && !strcmp("/testcase-data/phandle-tests/consumer-a", name), in of_unittest_find_node_by_name()
100 of_node_put(np); in of_unittest_find_node_by_name()
103 np = of_find_node_by_path("testcase-alias"); in of_unittest_find_node_by_name()
104 name = kasprintf(GFP_KERNEL, "%pOF", np); in of_unittest_find_node_by_name()
105 unittest(np && name && !strcmp("/testcase-data", name), in of_unittest_find_node_by_name()
107 of_node_put(np); in of_unittest_find_node_by_name()
111 np = of_find_node_by_path("testcase-alias/"); in of_unittest_find_node_by_name()
112 unittest(!np, "trailing '/' on testcase-alias/ should fail\n"); in of_unittest_find_node_by_name()
114 np = of_find_node_by_path("testcase-alias/phandle-tests/consumer-a"); in of_unittest_find_node_by_name()
115 name = kasprintf(GFP_KERNEL, "%pOF", np); in of_unittest_find_node_by_name()
116 unittest(np && name && !strcmp("/testcase-data/phandle-tests/consumer-a", name), in of_unittest_find_node_by_name()
118 of_node_put(np); in of_unittest_find_node_by_name()
121 np = of_find_node_by_path("/testcase-data/missing-path"); in of_unittest_find_node_by_name()
122 unittest(!np, "non-existent path returned node %pOF\n", np); in of_unittest_find_node_by_name()
123 of_node_put(np); in of_unittest_find_node_by_name()
125 np = of_find_node_by_path("missing-alias"); in of_unittest_find_node_by_name()
126 unittest(!np, "non-existent alias returned node %pOF\n", np); in of_unittest_find_node_by_name()
127 of_node_put(np); in of_unittest_find_node_by_name()
129 np = of_find_node_by_path("testcase-alias/missing-path"); in of_unittest_find_node_by_name()
130 unittest(!np, "non-existent alias with relative path returned node %pOF\n", np); in of_unittest_find_node_by_name()
131 of_node_put(np); in of_unittest_find_node_by_name()
133 np = of_find_node_opts_by_path("/testcase-data:testoption", &options); in of_unittest_find_node_by_name()
134 unittest(np && !strcmp("testoption", options), in of_unittest_find_node_by_name()
136 of_node_put(np); in of_unittest_find_node_by_name()
138 np = of_find_node_opts_by_path("/testcase-data:test/option", &options); in of_unittest_find_node_by_name()
139 unittest(np && !strcmp("test/option", options), in of_unittest_find_node_by_name()
141 of_node_put(np); in of_unittest_find_node_by_name()
143 np = of_find_node_opts_by_path("/testcase-data/testcase-device1:test/option", &options); in of_unittest_find_node_by_name()
144 unittest(np && !strcmp("test/option", options), in of_unittest_find_node_by_name()
146 of_node_put(np); in of_unittest_find_node_by_name()
148 np = of_find_node_opts_by_path("/testcase-data:testoption", NULL); in of_unittest_find_node_by_name()
149 unittest(np, "NULL option path test failed\n"); in of_unittest_find_node_by_name()
150 of_node_put(np); in of_unittest_find_node_by_name()
152 np = of_find_node_opts_by_path("testcase-alias:testaliasoption", in of_unittest_find_node_by_name()
154 unittest(np && !strcmp("testaliasoption", options), in of_unittest_find_node_by_name()
156 of_node_put(np); in of_unittest_find_node_by_name()
158 np = of_find_node_opts_by_path("testcase-alias:test/alias/option", in of_unittest_find_node_by_name()
160 unittest(np && !strcmp("test/alias/option", options), in of_unittest_find_node_by_name()
162 of_node_put(np); in of_unittest_find_node_by_name()
164 np = of_find_node_opts_by_path("testcase-alias:testaliasoption", NULL); in of_unittest_find_node_by_name()
165 unittest(np, "NULL option alias path test failed\n"); in of_unittest_find_node_by_name()
166 of_node_put(np); in of_unittest_find_node_by_name()
169 np = of_find_node_opts_by_path("testcase-alias", &options); in of_unittest_find_node_by_name()
170 unittest(np && !options, "option clearing test failed\n"); in of_unittest_find_node_by_name()
171 of_node_put(np); in of_unittest_find_node_by_name()
174 np = of_find_node_opts_by_path("/", &options); in of_unittest_find_node_by_name()
175 unittest(np && !options, "option clearing root node test failed\n"); in of_unittest_find_node_by_name()
176 of_node_put(np); in of_unittest_find_node_by_name()
181 struct device_node *np; in of_unittest_dynamic() local
184 np = of_find_node_by_path("/testcase-data"); in of_unittest_dynamic()
185 if (!np) { in of_unittest_dynamic()
201 unittest(of_add_property(np, prop) == 0, "Adding a new property failed\n"); in of_unittest_dynamic()
208 unittest(of_add_property(np, prop) != 0, in of_unittest_dynamic()
214 unittest(of_update_property(np, prop) == 0, in of_unittest_dynamic()
222 unittest(of_update_property(np, prop) == 0, in of_unittest_dynamic()
226 unittest(of_remove_property(np, prop) == 0, in of_unittest_dynamic()
236 unittest(of_add_property(np, prop) == 0, in of_unittest_dynamic()
240 static int __init of_unittest_check_node_linkage(struct device_node *np) in of_unittest_check_node_linkage() argument
245 for_each_child_of_node(np, child) { in of_unittest_check_node_linkage()
246 if (child->parent != np) { in of_unittest_check_node_linkage()
248 child, np); in of_unittest_check_node_linkage()
267 struct device_node *np; in of_unittest_check_tree_linkage() local
273 for_each_of_allnodes(np) in of_unittest_check_tree_linkage()
284 static void __init of_unittest_printf_one(struct device_node *np, const char *fmt, in of_unittest_printf_one() argument
298 size = snprintf(buf, buf_size - 2, fmt, np); in of_unittest_printf_one()
310 snprintf(buf, size+1, fmt, np); in of_unittest_printf_one()
320 struct device_node *np; in of_unittest_printf() local
324 np = of_find_node_by_path(full_name); in of_unittest_printf()
325 if (!np) { in of_unittest_printf()
326 unittest(np, "testcase data missing\n"); in of_unittest_printf()
330 num_to_str(phandle_str, sizeof(phandle_str), np->phandle, 0); in of_unittest_printf()
332 of_unittest_printf_one(np, "%pOF", full_name); in of_unittest_printf()
333 of_unittest_printf_one(np, "%pOFf", full_name); in of_unittest_printf()
334 of_unittest_printf_one(np, "%pOFn", "dev"); in of_unittest_printf()
335 of_unittest_printf_one(np, "%2pOFn", "dev"); in of_unittest_printf()
336 of_unittest_printf_one(np, "%5pOFn", " dev"); in of_unittest_printf()
337 of_unittest_printf_one(np, "%pOFnc", "dev:test-sub-device"); in of_unittest_printf()
338 of_unittest_printf_one(np, "%pOFp", phandle_str); in of_unittest_printf()
339 of_unittest_printf_one(np, "%pOFP", "dev@100"); in of_unittest_printf()
340 of_unittest_printf_one(np, "ABC %pOFP ABC", "ABC dev@100 ABC"); in of_unittest_printf()
341 of_unittest_printf_one(np, "%10pOFP", " dev@100"); in of_unittest_printf()
342 of_unittest_printf_one(np, "%-10pOFP", "dev@100 "); in of_unittest_printf()
344 of_unittest_printf_one(np, "%pOFF", "----"); in of_unittest_printf()
345 of_unittest_printf_one(np, "%pOFPF", "dev@100:----"); in of_unittest_printf()
346 of_unittest_printf_one(np, "%pOFPFPc", "dev@100:----:dev@100:test-sub-device"); in of_unittest_printf()
347 of_unittest_printf_one(np, "%pOFc", "test-sub-device"); in of_unittest_printf()
348 of_unittest_printf_one(np, "%pOFC", in of_unittest_printf()
354 struct device_node *np; member
360 struct device_node *np; in of_unittest_check_phandles() local
365 for_each_of_allnodes(np) { in of_unittest_check_phandles()
366 if (!np->phandle) in of_unittest_check_phandles()
369 hash_for_each_possible(phandle_ht, nh, node, np->phandle) { in of_unittest_check_phandles()
370 if (nh->np->phandle == np->phandle) { in of_unittest_check_phandles()
372 np->phandle, nh->np, np); in of_unittest_check_phandles()
382 nh->np = np; in of_unittest_check_phandles()
383 hash_add(phandle_ht, &nh->node, np->phandle); in of_unittest_check_phandles()
398 struct device_node *np; in of_unittest_parse_phandle_with_args() local
402 np = of_find_node_by_path("/testcase-data/phandle-tests/consumer-a"); in of_unittest_parse_phandle_with_args()
403 if (!np) { in of_unittest_parse_phandle_with_args()
408 rc = of_count_phandle_with_args(np, "phandle-list", "#phandle-cells"); in of_unittest_parse_phandle_with_args()
415 rc = of_parse_phandle_with_args(np, "phandle-list", in of_unittest_parse_phandle_with_args()
464 i, args.np, rc); in of_unittest_parse_phandle_with_args()
467 of_node_put(args.np); in of_unittest_parse_phandle_with_args()
472 rc = of_parse_phandle_with_args(np, "phandle-list-missing", in of_unittest_parse_phandle_with_args()
475 rc = of_count_phandle_with_args(np, "phandle-list-missing", in of_unittest_parse_phandle_with_args()
485 rc = of_parse_phandle_with_args(np, "phandle-list", in of_unittest_parse_phandle_with_args()
496 rc = of_count_phandle_with_args(np, "phandle-list", in of_unittest_parse_phandle_with_args()
510 rc = of_parse_phandle_with_args(np, "phandle-list-bad-phandle", in of_unittest_parse_phandle_with_args()
521 rc = of_count_phandle_with_args(np, "phandle-list-bad-phandle", in of_unittest_parse_phandle_with_args()
535 rc = of_parse_phandle_with_args(np, "phandle-list-bad-args", in of_unittest_parse_phandle_with_args()
546 rc = of_count_phandle_with_args(np, "phandle-list-bad-args", in of_unittest_parse_phandle_with_args()
557 struct device_node *np, *p[6] = {}; in of_unittest_parse_phandle_with_args_map() local
562 np = of_find_node_by_path("/testcase-data/phandle-tests/consumer-b"); in of_unittest_parse_phandle_with_args_map()
563 if (!np) { in of_unittest_parse_phandle_with_args_map()
582 rc = of_count_phandle_with_args(np, "phandle-list", "#phandle-cells"); in of_unittest_parse_phandle_with_args_map()
589 rc = of_parse_phandle_with_args_map(np, "phandle-list", in of_unittest_parse_phandle_with_args_map()
596 passed &= (args.np == p[1]); in of_unittest_parse_phandle_with_args_map()
602 passed &= (args.np == p[3]); in of_unittest_parse_phandle_with_args_map()
613 passed &= (args.np == p[0]); in of_unittest_parse_phandle_with_args_map()
618 passed &= (args.np == p[1]); in of_unittest_parse_phandle_with_args_map()
624 passed &= (args.np == p[0]); in of_unittest_parse_phandle_with_args_map()
629 passed &= (args.np == p[2]); in of_unittest_parse_phandle_with_args_map()
636 passed &= (args.np == p[3]); in of_unittest_parse_phandle_with_args_map()
650 i, args.np->full_name, rc); in of_unittest_parse_phandle_with_args_map()
653 of_node_put(args.np); in of_unittest_parse_phandle_with_args_map()
658 rc = of_parse_phandle_with_args_map(np, "phandle-list-missing", in of_unittest_parse_phandle_with_args_map()
668 rc = of_parse_phandle_with_args_map(np, "phandle-list", in of_unittest_parse_phandle_with_args_map()
681 rc = of_parse_phandle_with_args_map(np, "phandle-list-bad-phandle", in of_unittest_parse_phandle_with_args_map()
694 rc = of_parse_phandle_with_args_map(np, "phandle-list-bad-args", in of_unittest_parse_phandle_with_args_map()
712 struct device_node *np; in of_unittest_property_string() local
715 np = of_find_node_by_path("/testcase-data/phandle-tests/consumer-a"); in of_unittest_property_string()
716 if (!np) { in of_unittest_property_string()
721 rc = of_property_match_string(np, "phandle-list-names", "first"); in of_unittest_property_string()
723 rc = of_property_match_string(np, "phandle-list-names", "second"); in of_unittest_property_string()
725 rc = of_property_match_string(np, "phandle-list-names", "third"); in of_unittest_property_string()
727 rc = of_property_match_string(np, "phandle-list-names", "fourth"); in of_unittest_property_string()
729 rc = of_property_match_string(np, "missing-property", "blah"); in of_unittest_property_string()
731 rc = of_property_match_string(np, "empty-property", "blah"); in of_unittest_property_string()
733 rc = of_property_match_string(np, "unterminated-string", "blah"); in of_unittest_property_string()
737 rc = of_property_count_strings(np, "string-property"); in of_unittest_property_string()
739 rc = of_property_count_strings(np, "phandle-list-names"); in of_unittest_property_string()
741 rc = of_property_count_strings(np, "unterminated-string"); in of_unittest_property_string()
743 rc = of_property_count_strings(np, "unterminated-string-list"); in of_unittest_property_string()
747 rc = of_property_read_string_index(np, "string-property", 0, strings); in of_unittest_property_string()
750 rc = of_property_read_string_index(np, "string-property", 1, strings); in of_unittest_property_string()
752 rc = of_property_read_string_index(np, "phandle-list-names", 0, strings); in of_unittest_property_string()
754 rc = of_property_read_string_index(np, "phandle-list-names", 1, strings); in of_unittest_property_string()
756 rc = of_property_read_string_index(np, "phandle-list-names", 2, strings); in of_unittest_property_string()
759 rc = of_property_read_string_index(np, "phandle-list-names", 3, strings); in of_unittest_property_string()
762 rc = of_property_read_string_index(np, "unterminated-string", 0, strings); in of_unittest_property_string()
764 rc = of_property_read_string_index(np, "unterminated-string-list", 0, strings); in of_unittest_property_string()
767 rc = of_property_read_string_index(np, "unterminated-string-list", 2, strings); /* should fail */ in of_unittest_property_string()
772 rc = of_property_read_string_array(np, "string-property", strings, 4); in of_unittest_property_string()
774 rc = of_property_read_string_array(np, "phandle-list-names", strings, 4); in of_unittest_property_string()
776 rc = of_property_read_string_array(np, "unterminated-string", strings, 4); in of_unittest_property_string()
779 rc = of_property_read_string_array(np, "unterminated-string-list", strings, 4); in of_unittest_property_string()
783 rc = of_property_read_string_array(np, "unterminated-string-list", strings, 2); in of_unittest_property_string()
786 rc = of_property_read_string_array(np, "phandle-list-names", strings, 1); in of_unittest_property_string()
825 struct device_node *n1, *n2, *n21, *n22, *nchangeset, *nremove, *parent, *np; in of_unittest_changeset() local
900 unittest((np = of_find_node_by_path("/testcase-data/changeset/n2/n21")), in of_unittest_changeset()
902 of_node_put(np); in of_unittest_changeset()
903 unittest((np = of_find_node_by_path("/testcase-data/changeset/n2/n22")), in of_unittest_changeset()
905 of_node_put(np); in of_unittest_changeset()
931 struct device_node *np; in of_unittest_dma_get_max_cpu_address() local
937 np = of_find_node_by_path("/testcase-data/address-tests"); in of_unittest_dma_get_max_cpu_address()
938 if (!np) { in of_unittest_dma_get_max_cpu_address()
943 cpu_addr = of_dma_get_max_cpu_address(np); in of_unittest_dma_get_max_cpu_address()
953 struct device_node *np; in of_unittest_dma_ranges_one() local
957 np = of_find_node_by_path(path); in of_unittest_dma_ranges_one()
958 if (!np) { in of_unittest_dma_ranges_one()
963 rc = of_dma_get_range(np, &map); in of_unittest_dma_ranges_one()
965 unittest(!rc, "of_dma_get_range failed on node %pOF rc=%i\n", np, rc); in of_unittest_dma_ranges_one()
985 &paddr, expect_paddr, np); in of_unittest_dma_ranges_one()
988 &dma_addr, expect_dma_addr, np); in of_unittest_dma_ranges_one()
993 of_node_put(np); in of_unittest_dma_ranges_one()
1010 struct device_node *np; in of_unittest_pci_dma_ranges() local
1018 np = of_find_node_by_path("/testcase-data/address-tests/pci@90000000"); in of_unittest_pci_dma_ranges()
1019 if (!np) { in of_unittest_pci_dma_ranges()
1024 if (of_pci_dma_range_parser_init(&parser, np)) { in of_unittest_pci_dma_ranges()
1036 np, range.size); in of_unittest_pci_dma_ranges()
1039 range.cpu_addr, np); in of_unittest_pci_dma_ranges()
1042 range.pci_addr, np); in of_unittest_pci_dma_ranges()
1046 np, range.size); in of_unittest_pci_dma_ranges()
1049 range.cpu_addr, np); in of_unittest_pci_dma_ranges()
1052 range.pci_addr, np); in of_unittest_pci_dma_ranges()
1057 of_node_put(np); in of_unittest_pci_dma_ranges()
1062 struct device_node *np; in of_unittest_bus_ranges() local
1068 np = of_find_node_by_path("/testcase-data/address-tests"); in of_unittest_bus_ranges()
1069 if (!np) { in of_unittest_bus_ranges()
1074 if (of_range_parser_init(&parser, np)) { in of_unittest_bus_ranges()
1079 ret = of_range_to_resource(np, 1, &res); in of_unittest_bus_ranges()
1081 ret, np); in of_unittest_bus_ranges()
1084 np, &res); in of_unittest_bus_ranges()
1087 np, &res); in of_unittest_bus_ranges()
1090 np, &res); in of_unittest_bus_ranges()
1095 np, count); in of_unittest_bus_ranges()
1103 np, range.flags, IORESOURCE_MEM); in of_unittest_bus_ranges()
1107 np, range.size); in of_unittest_bus_ranges()
1110 range.cpu_addr, np); in of_unittest_bus_ranges()
1113 range.pci_addr, np); in of_unittest_bus_ranges()
1117 np, range.size); in of_unittest_bus_ranges()
1120 range.cpu_addr, np); in of_unittest_bus_ranges()
1123 range.pci_addr, np); in of_unittest_bus_ranges()
1128 of_node_put(np); in of_unittest_bus_ranges()
1133 struct device_node *np; in of_unittest_bus_3cell_ranges() local
1138 np = of_find_node_by_path("/testcase-data/address-tests/bus@a0000000"); in of_unittest_bus_3cell_ranges()
1139 if (!np) { in of_unittest_bus_3cell_ranges()
1144 if (of_range_parser_init(&parser, np)) { in of_unittest_bus_3cell_ranges()
1156 np, range.flags); in of_unittest_bus_3cell_ranges()
1159 np, range.size); in of_unittest_bus_3cell_ranges()
1162 range.cpu_addr, np); in of_unittest_bus_3cell_ranges()
1165 range.pci_addr, np); in of_unittest_bus_3cell_ranges()
1169 np, range.flags); in of_unittest_bus_3cell_ranges()
1172 np, range.size); in of_unittest_bus_3cell_ranges()
1175 range.cpu_addr, np); in of_unittest_bus_3cell_ranges()
1178 range.pci_addr, np); in of_unittest_bus_3cell_ranges()
1183 of_node_put(np); in of_unittest_bus_3cell_ranges()
1188 struct device_node *np; in of_unittest_reg() local
1193 np = of_find_node_by_path("/testcase-data/address-tests/bus@80000000/device@1000"); in of_unittest_reg()
1194 if (!np) { in of_unittest_reg()
1199 ret = of_property_read_reg(np, 0, &addr, &size); in of_unittest_reg()
1201 np, ret); in of_unittest_reg()
1203 np, addr); in of_unittest_reg()
1205 of_node_put(np); in of_unittest_reg()
1207 np = of_find_node_by_path("/testcase-data/platform-tests-2/node/test-device@100"); in of_unittest_reg()
1208 if (!np) { in of_unittest_reg()
1213 ret = of_address_to_resource(np, 0, &res); in of_unittest_reg()
1215 np); in of_unittest_reg()
1217 of_node_put(np); in of_unittest_reg()
1223 struct device_node *np; in of_unittest_parse_interrupts() local
1230 np = of_find_node_by_path("/testcase-data/interrupts/interrupts0"); in of_unittest_parse_interrupts()
1231 if (!np) { in of_unittest_parse_interrupts()
1240 rc = of_irq_parse_one(np, i, &args); in of_unittest_parse_interrupts()
1247 i, args.np, rc); in of_unittest_parse_interrupts()
1249 of_node_put(np); in of_unittest_parse_interrupts()
1251 np = of_find_node_by_path("/testcase-data/interrupts/interrupts1"); in of_unittest_parse_interrupts()
1252 if (!np) { in of_unittest_parse_interrupts()
1261 rc = of_irq_parse_one(np, i, &args); in of_unittest_parse_interrupts()
1293 i, args.np, rc); in of_unittest_parse_interrupts()
1295 of_node_put(np); in of_unittest_parse_interrupts()
1300 struct device_node *np; in of_unittest_parse_interrupts_extended() local
1307 np = of_find_node_by_path("/testcase-data/interrupts/interrupts-extended0"); in of_unittest_parse_interrupts_extended()
1308 if (!np) { in of_unittest_parse_interrupts_extended()
1317 rc = of_irq_parse_one(np, i, &args); in of_unittest_parse_interrupts_extended()
1373 i, args.np, rc); in of_unittest_parse_interrupts_extended()
1375 of_node_put(np); in of_unittest_parse_interrupts_extended()
1415 struct device_node *np; in of_unittest_match_node() local
1420 np = of_find_node_by_path(match_node_tests[i].path); in of_unittest_match_node()
1421 if (!np) { in of_unittest_match_node()
1427 match = of_match_node(match_node_table, np); in of_unittest_match_node()
1451 struct device_node *np, *child, *grandchild; in of_unittest_platform_populate() local
1458 np = of_find_node_by_path("/testcase-data"); in of_unittest_platform_populate()
1459 of_platform_default_populate(np, NULL, NULL); in of_unittest_platform_populate()
1462 np = of_find_node_by_path("/testcase-data/testcase-device1"); in of_unittest_platform_populate()
1463 pdev = of_find_device_by_node(np); in of_unittest_platform_populate()
1472 np = of_find_node_by_path("/testcase-data/testcase-device2"); in of_unittest_platform_populate()
1473 pdev = of_find_device_by_node(np); in of_unittest_platform_populate()
1488 np = of_find_node_by_path("/testcase-data/platform-tests"); in of_unittest_platform_populate()
1489 unittest(np, "No testcase data in device tree\n"); in of_unittest_platform_populate()
1490 if (!np) in of_unittest_platform_populate()
1497 of_node_put(np); in of_unittest_platform_populate()
1500 test_bus->dev.of_node = np; in of_unittest_platform_populate()
1511 of_platform_populate(np, match, NULL, &test_bus->dev); in of_unittest_platform_populate()
1512 for_each_child_of_node(np, child) { in of_unittest_platform_populate()
1523 for_each_child_of_node(np, child) { in of_unittest_platform_populate()
1531 of_node_put(np); in of_unittest_platform_populate()
1542 static void update_node_properties(struct device_node *np, in update_node_properties() argument
1550 for_each_child_of_node(np, child) in update_node_properties()
1570 for (prop = np->properties; prop != NULL; prop = save_next) { in update_node_properties()
1577 np, prop->name); in update_node_properties()
1592 static void attach_node_and_children(struct device_node *np) in attach_node_and_children() argument
1598 full_name = kasprintf(GFP_KERNEL, "%pOF", np); in attach_node_and_children()
1611 update_node_properties(np, dup); in attach_node_and_children()
1615 child = np->child; in attach_node_and_children()
1616 np->child = NULL; in attach_node_and_children()
1620 np->sibling = np->parent->child; in attach_node_and_children()
1621 np->parent->child = np; in attach_node_and_children()
1622 of_node_clear_flag(np, OF_DETACHED); in attach_node_and_children()
1625 __of_attach_node_sysfs(np); in attach_node_and_children()
1643 struct device_node *unittest_data_node = NULL, *np; in unittest_data_add() local
1693 for_each_of_allnodes(np) in unittest_data_add()
1694 __of_attach_node_sysfs(np); in unittest_data_add()
1705 np = unittest_data_node->child; in unittest_data_add()
1706 while (np) { in unittest_data_add()
1707 struct device_node *next = np->sibling; in unittest_data_add()
1709 np->parent = of_root; in unittest_data_add()
1711 attach_node_and_children(np); in unittest_data_add()
1712 np = next; in unittest_data_add()
1729 struct device_node *np = dev->of_node; in unittest_probe() local
1731 if (np == NULL) { in unittest_probe()
1737 dev_dbg(dev, "%s for node @%pOF\n", __func__, np); in unittest_probe()
1739 of_platform_populate(np, NULL, NULL, &pdev->dev); in unittest_probe()
1747 struct device_node *np = dev->of_node; in unittest_remove() local
1749 dev_dbg(dev, "%s for node @%pOF\n", __func__, np); in unittest_remove()
1769 struct device_node *np; in of_path_to_platform_device() local
1772 np = of_find_node_by_path(path); in of_path_to_platform_device()
1773 if (np == NULL) in of_path_to_platform_device()
1776 pdev = of_find_device_by_node(np); in of_path_to_platform_device()
1777 of_node_put(np); in of_path_to_platform_device()
2005 struct device_node *np; in of_path_to_i2c_client() local
2008 np = of_find_node_by_path(path); in of_path_to_i2c_client()
2009 if (np == NULL) in of_path_to_i2c_client()
2012 client = of_find_i2c_device_by_node(np); in of_path_to_i2c_client()
2013 of_node_put(np); in of_path_to_i2c_client()
2622 struct device_node *np = dev->of_node; in unittest_i2c_bus_probe() local
2627 if (np == NULL) { in unittest_i2c_bus_probe()
2633 dev_dbg(dev, "%s for node @%pOF\n", __func__, np); in unittest_i2c_bus_probe()
2666 struct device_node *np = dev->of_node; in unittest_i2c_bus_remove() local
2669 dev_dbg(dev, "%s for node @%pOF\n", __func__, np); in unittest_i2c_bus_remove()
2690 struct device_node *np = client->dev.of_node; in unittest_i2c_dev_probe() local
2692 if (!np) { in unittest_i2c_dev_probe()
2697 dev_dbg(dev, "%s for node @%pOF\n", __func__, np); in unittest_i2c_dev_probe()
2705 struct device_node *np = client->dev.of_node; in unittest_i2c_dev_remove() local
2707 dev_dbg(dev, "%s for node @%pOF\n", __func__, np); in unittest_i2c_dev_remove()
2736 struct device_node *np = client->dev.of_node, *child; in unittest_i2c_mux_probe() local
2740 dev_dbg(dev, "%s for node @%pOF\n", __func__, np); in unittest_i2c_mux_probe()
2742 if (!np) { in unittest_i2c_mux_probe()
2748 for_each_child_of_node(np, child) { in unittest_i2c_mux_probe()
2780 struct device_node *np = client->dev.of_node; in unittest_i2c_mux_remove() local
2783 dev_dbg(dev, "%s for node @%pOF\n", __func__, np); in unittest_i2c_mux_remove()
3179 struct device_node *np; in of_unittest_lifecycle() local
3195 np = of_find_node_by_path(refcount_path); in of_unittest_lifecycle()
3196 unittest(np, "find refcount_path \"%s\"\n", refcount_path); in of_unittest_lifecycle()
3197 if (np == NULL) in of_unittest_lifecycle()
3207 refcount = kref_read(&np->kobj.kref); in of_unittest_lifecycle()
3211 of_node_put(np); in of_unittest_lifecycle()
3222 of_node_put(np); in of_unittest_lifecycle()
3242 of_node_put(np); in of_unittest_lifecycle()
3259 of_node_put(np); in of_unittest_lifecycle()
3283 np = of_find_node_by_path(refcount_parent_path); in of_unittest_lifecycle()
3284 unittest(np, "find refcount_parent_path \"%s\"\n", refcount_parent_path); in of_unittest_lifecycle()
3285 unittest(np, "ERROR: devicetree live tree left in a 'bad state' if test fail\n"); in of_unittest_lifecycle()
3286 if (np == NULL) in of_unittest_lifecycle()
3289 prev_sibling = np->child; in of_unittest_lifecycle()
3292 np->child = next_sibling; in of_unittest_lifecycle()
3301 of_node_put(np); in of_unittest_lifecycle()
3566 struct device_node *np; in of_unittest_overlay_high_level() local
3597 for (np = overlay_base_root->child; np; np = np->sibling) { in of_unittest_overlay_high_level()
3598 if (of_node_name_eq(np, "__local_fixups__")) { in of_unittest_overlay_high_level()
3599 *pprev = np->sibling; in of_unittest_overlay_high_level()
3602 pprev = &np->sibling; in of_unittest_overlay_high_level()
3610 for (np = overlay_base_root->child; np; np = np->sibling) { in of_unittest_overlay_high_level()
3611 if (of_node_name_eq(np, "__symbols__")) { in of_unittest_overlay_high_level()
3612 overlay_base_symbols = np; in of_unittest_overlay_high_level()
3613 *pprev = np->sibling; in of_unittest_overlay_high_level()
3616 pprev = &np->sibling; in of_unittest_overlay_high_level()
3620 for_each_child_of_node(overlay_base_root, np) { in of_unittest_overlay_high_level()
3623 if (!strcmp(np->full_name, base_child->full_name)) { in of_unittest_overlay_high_level()
3625 np); in of_unittest_overlay_high_level()
3626 of_node_put(np); in of_unittest_overlay_high_level()
3641 for (np = overlay_base_root->child; np; np = np->sibling) in of_unittest_overlay_high_level()
3642 np->parent = of_root; in of_unittest_overlay_high_level()
3646 for (last_sibling = np = of_root->child; np; np = np->sibling) in of_unittest_overlay_high_level()
3647 last_sibling = np; in of_unittest_overlay_high_level()
3654 for_each_of_allnodes_from(overlay_base_root, np) in of_unittest_overlay_high_level()
3655 __of_attach_node_sysfs(np); in of_unittest_overlay_high_level()
3936 struct device_node *pnp, *np = NULL; in of_unittest_pci_node_verify() local
3949 np = of_find_node_by_path(path); in of_unittest_pci_node_verify()
3950 unittest(np, "Failed to get unittest-pci node under PCI node\n"); in of_unittest_pci_node_verify()
3951 if (!np) { in of_unittest_pci_node_verify()
3956 reg = of_get_property(np, "reg", NULL); in of_unittest_pci_node_verify()
3962 np = of_find_node_by_path(path); in of_unittest_pci_node_verify()
3963 unittest(!np, "Child device tree node is not removed\n"); in of_unittest_pci_node_verify()
3970 if (np) in of_unittest_pci_node_verify()
3971 of_node_put(np); in of_unittest_pci_node_verify()
4025 struct device_node *np; in of_unittest() local
4040 np = of_find_node_by_path("/testcase-data/phandle-tests/consumer-a"); in of_unittest()
4041 if (!np) { in of_unittest()
4045 of_node_put(np); in of_unittest()