Lines Matching full:np
76 struct device_node *np; in of_unittest_find_node_by_name() local
79 np = of_find_node_by_path("/testcase-data"); in of_unittest_find_node_by_name()
80 name = kasprintf(GFP_KERNEL, "%pOF", np); in of_unittest_find_node_by_name()
81 unittest(np && name && !strcmp("/testcase-data", name), in of_unittest_find_node_by_name()
83 of_node_put(np); in of_unittest_find_node_by_name()
87 np = of_find_node_by_path("/testcase-data/"); in of_unittest_find_node_by_name()
88 unittest(!np, "trailing '/' on /testcase-data/ should fail\n"); in of_unittest_find_node_by_name()
90 np = of_find_node_by_path("/testcase-data/phandle-tests/consumer-a"); in of_unittest_find_node_by_name()
91 name = kasprintf(GFP_KERNEL, "%pOF", np); in of_unittest_find_node_by_name()
92 unittest(np && name && !strcmp("/testcase-data/phandle-tests/consumer-a", name), in of_unittest_find_node_by_name()
94 of_node_put(np); in of_unittest_find_node_by_name()
97 np = of_find_node_by_path("testcase-alias"); in of_unittest_find_node_by_name()
98 name = kasprintf(GFP_KERNEL, "%pOF", np); in of_unittest_find_node_by_name()
99 unittest(np && name && !strcmp("/testcase-data", name), in of_unittest_find_node_by_name()
101 of_node_put(np); in of_unittest_find_node_by_name()
105 np = of_find_node_by_path("testcase-alias/"); in of_unittest_find_node_by_name()
106 unittest(!np, "trailing '/' on testcase-alias/ should fail\n"); in of_unittest_find_node_by_name()
108 np = of_find_node_by_path("testcase-alias/phandle-tests/consumer-a"); in of_unittest_find_node_by_name()
109 name = kasprintf(GFP_KERNEL, "%pOF", np); in of_unittest_find_node_by_name()
110 unittest(np && name && !strcmp("/testcase-data/phandle-tests/consumer-a", name), in of_unittest_find_node_by_name()
112 of_node_put(np); in of_unittest_find_node_by_name()
115 np = of_find_node_by_path("/testcase-data/missing-path"); in of_unittest_find_node_by_name()
116 unittest(!np, "non-existent path returned node %pOF\n", np); in of_unittest_find_node_by_name()
117 of_node_put(np); in of_unittest_find_node_by_name()
119 np = of_find_node_by_path("missing-alias"); in of_unittest_find_node_by_name()
120 unittest(!np, "non-existent alias returned node %pOF\n", np); in of_unittest_find_node_by_name()
121 of_node_put(np); in of_unittest_find_node_by_name()
123 np = of_find_node_by_path("testcase-alias/missing-path"); in of_unittest_find_node_by_name()
124 unittest(!np, "non-existent alias with relative path returned node %pOF\n", np); in of_unittest_find_node_by_name()
125 of_node_put(np); in of_unittest_find_node_by_name()
127 np = of_find_node_opts_by_path("/testcase-data:testoption", &options); in of_unittest_find_node_by_name()
128 unittest(np && !strcmp("testoption", options), in of_unittest_find_node_by_name()
130 of_node_put(np); in of_unittest_find_node_by_name()
132 np = of_find_node_opts_by_path("/testcase-data:test/option", &options); in of_unittest_find_node_by_name()
133 unittest(np && !strcmp("test/option", options), in of_unittest_find_node_by_name()
135 of_node_put(np); in of_unittest_find_node_by_name()
137 np = of_find_node_opts_by_path("/testcase-data/testcase-device1:test/option", &options); in of_unittest_find_node_by_name()
138 unittest(np && !strcmp("test/option", options), in of_unittest_find_node_by_name()
140 of_node_put(np); in of_unittest_find_node_by_name()
142 np = of_find_node_opts_by_path("/testcase-data:testoption", NULL); in of_unittest_find_node_by_name()
143 unittest(np, "NULL option path test failed\n"); in of_unittest_find_node_by_name()
144 of_node_put(np); in of_unittest_find_node_by_name()
146 np = of_find_node_opts_by_path("testcase-alias:testaliasoption", in of_unittest_find_node_by_name()
148 unittest(np && !strcmp("testaliasoption", options), 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:test/alias/option", in of_unittest_find_node_by_name()
154 unittest(np && !strcmp("test/alias/option", 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:testaliasoption", NULL); in of_unittest_find_node_by_name()
159 unittest(np, "NULL option alias path test failed\n"); in of_unittest_find_node_by_name()
160 of_node_put(np); in of_unittest_find_node_by_name()
163 np = of_find_node_opts_by_path("testcase-alias", &options); in of_unittest_find_node_by_name()
164 unittest(np && !options, "option clearing test failed\n"); in of_unittest_find_node_by_name()
165 of_node_put(np); in of_unittest_find_node_by_name()
168 np = of_find_node_opts_by_path("/", &options); in of_unittest_find_node_by_name()
169 unittest(np && !options, "option clearing root node test failed\n"); in of_unittest_find_node_by_name()
170 of_node_put(np); in of_unittest_find_node_by_name()
175 struct device_node *np; in of_unittest_dynamic() local
178 np = of_find_node_by_path("/testcase-data"); in of_unittest_dynamic()
179 if (!np) { in of_unittest_dynamic()
195 unittest(of_add_property(np, prop) == 0, "Adding a new property failed\n"); in of_unittest_dynamic()
202 unittest(of_add_property(np, prop) != 0, in of_unittest_dynamic()
208 unittest(of_update_property(np, prop) == 0, in of_unittest_dynamic()
216 unittest(of_update_property(np, prop) == 0, in of_unittest_dynamic()
220 unittest(of_remove_property(np, prop) == 0, in of_unittest_dynamic()
230 unittest(of_add_property(np, prop) == 0, in of_unittest_dynamic()
234 static int __init of_unittest_check_node_linkage(struct device_node *np) in of_unittest_check_node_linkage() argument
239 for_each_child_of_node(np, child) { in of_unittest_check_node_linkage()
240 if (child->parent != np) { in of_unittest_check_node_linkage()
242 child, np); in of_unittest_check_node_linkage()
261 struct device_node *np; in of_unittest_check_tree_linkage() local
267 for_each_of_allnodes(np) in of_unittest_check_tree_linkage()
278 static void __init of_unittest_printf_one(struct device_node *np, const char *fmt, in of_unittest_printf_one() argument
292 size = snprintf(buf, buf_size - 2, fmt, np); in of_unittest_printf_one()
304 snprintf(buf, size+1, fmt, np); in of_unittest_printf_one()
314 struct device_node *np; in of_unittest_printf() local
318 np = of_find_node_by_path(full_name); in of_unittest_printf()
319 if (!np) { in of_unittest_printf()
320 unittest(np, "testcase data missing\n"); in of_unittest_printf()
324 num_to_str(phandle_str, sizeof(phandle_str), np->phandle, 0); in of_unittest_printf()
326 of_unittest_printf_one(np, "%pOF", full_name); in of_unittest_printf()
327 of_unittest_printf_one(np, "%pOFf", full_name); in of_unittest_printf()
328 of_unittest_printf_one(np, "%pOFn", "dev"); in of_unittest_printf()
329 of_unittest_printf_one(np, "%2pOFn", "dev"); in of_unittest_printf()
330 of_unittest_printf_one(np, "%5pOFn", " dev"); in of_unittest_printf()
331 of_unittest_printf_one(np, "%pOFnc", "dev:test-sub-device"); in of_unittest_printf()
332 of_unittest_printf_one(np, "%pOFp", phandle_str); in of_unittest_printf()
333 of_unittest_printf_one(np, "%pOFP", "dev@100"); in of_unittest_printf()
334 of_unittest_printf_one(np, "ABC %pOFP ABC", "ABC dev@100 ABC"); in of_unittest_printf()
335 of_unittest_printf_one(np, "%10pOFP", " dev@100"); in of_unittest_printf()
336 of_unittest_printf_one(np, "%-10pOFP", "dev@100 "); in of_unittest_printf()
338 of_unittest_printf_one(np, "%pOFF", "----"); in of_unittest_printf()
339 of_unittest_printf_one(np, "%pOFPF", "dev@100:----"); in of_unittest_printf()
340 of_unittest_printf_one(np, "%pOFPFPc", "dev@100:----:dev@100:test-sub-device"); in of_unittest_printf()
341 of_unittest_printf_one(np, "%pOFc", "test-sub-device"); in of_unittest_printf()
342 of_unittest_printf_one(np, "%pOFC", in of_unittest_printf()
348 struct device_node *np; member
354 struct device_node *np; in of_unittest_check_phandles() local
359 for_each_of_allnodes(np) { in of_unittest_check_phandles()
360 if (!np->phandle) in of_unittest_check_phandles()
363 hash_for_each_possible(phandle_ht, nh, node, np->phandle) { in of_unittest_check_phandles()
364 if (nh->np->phandle == np->phandle) { in of_unittest_check_phandles()
366 np->phandle, nh->np, np); in of_unittest_check_phandles()
376 nh->np = np; in of_unittest_check_phandles()
377 hash_add(phandle_ht, &nh->node, np->phandle); in of_unittest_check_phandles()
392 struct device_node *np; in of_unittest_parse_phandle_with_args() local
396 np = of_find_node_by_path("/testcase-data/phandle-tests/consumer-a"); in of_unittest_parse_phandle_with_args()
397 if (!np) { in of_unittest_parse_phandle_with_args()
402 rc = of_count_phandle_with_args(np, "phandle-list", "#phandle-cells"); in of_unittest_parse_phandle_with_args()
409 rc = of_parse_phandle_with_args(np, "phandle-list", in of_unittest_parse_phandle_with_args()
458 i, args.np, rc); in of_unittest_parse_phandle_with_args()
463 rc = of_parse_phandle_with_args(np, "phandle-list-missing", in of_unittest_parse_phandle_with_args()
466 rc = of_count_phandle_with_args(np, "phandle-list-missing", in of_unittest_parse_phandle_with_args()
476 rc = of_parse_phandle_with_args(np, "phandle-list", in of_unittest_parse_phandle_with_args()
487 rc = of_count_phandle_with_args(np, "phandle-list", in of_unittest_parse_phandle_with_args()
501 rc = of_parse_phandle_with_args(np, "phandle-list-bad-phandle", in of_unittest_parse_phandle_with_args()
512 rc = of_count_phandle_with_args(np, "phandle-list-bad-phandle", in of_unittest_parse_phandle_with_args()
526 rc = of_parse_phandle_with_args(np, "phandle-list-bad-args", in of_unittest_parse_phandle_with_args()
537 rc = of_count_phandle_with_args(np, "phandle-list-bad-args", in of_unittest_parse_phandle_with_args()
548 struct device_node *np, *p0, *p1, *p2, *p3; in of_unittest_parse_phandle_with_args_map() local
552 np = of_find_node_by_path("/testcase-data/phandle-tests/consumer-b"); in of_unittest_parse_phandle_with_args_map()
553 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 == p1); in of_unittest_parse_phandle_with_args_map()
602 passed &= (args.np == p3); in of_unittest_parse_phandle_with_args_map()
613 passed &= (args.np == p0); in of_unittest_parse_phandle_with_args_map()
618 passed &= (args.np == p1); in of_unittest_parse_phandle_with_args_map()
624 passed &= (args.np == p0); in of_unittest_parse_phandle_with_args_map()
629 passed &= (args.np == p2); in of_unittest_parse_phandle_with_args_map()
642 i, args.np->full_name, rc); in of_unittest_parse_phandle_with_args_map()
647 rc = of_parse_phandle_with_args_map(np, "phandle-list-missing", in of_unittest_parse_phandle_with_args_map()
657 rc = of_parse_phandle_with_args_map(np, "phandle-list", in of_unittest_parse_phandle_with_args_map()
670 rc = of_parse_phandle_with_args_map(np, "phandle-list-bad-phandle", in of_unittest_parse_phandle_with_args_map()
683 rc = of_parse_phandle_with_args_map(np, "phandle-list-bad-args", in of_unittest_parse_phandle_with_args_map()
694 struct device_node *np; in of_unittest_property_string() local
697 np = of_find_node_by_path("/testcase-data/phandle-tests/consumer-a"); in of_unittest_property_string()
698 if (!np) { in of_unittest_property_string()
703 rc = of_property_match_string(np, "phandle-list-names", "first"); in of_unittest_property_string()
705 rc = of_property_match_string(np, "phandle-list-names", "second"); in of_unittest_property_string()
707 rc = of_property_match_string(np, "phandle-list-names", "third"); in of_unittest_property_string()
709 rc = of_property_match_string(np, "phandle-list-names", "fourth"); in of_unittest_property_string()
711 rc = of_property_match_string(np, "missing-property", "blah"); in of_unittest_property_string()
713 rc = of_property_match_string(np, "empty-property", "blah"); in of_unittest_property_string()
715 rc = of_property_match_string(np, "unterminated-string", "blah"); in of_unittest_property_string()
719 rc = of_property_count_strings(np, "string-property"); in of_unittest_property_string()
721 rc = of_property_count_strings(np, "phandle-list-names"); in of_unittest_property_string()
723 rc = of_property_count_strings(np, "unterminated-string"); in of_unittest_property_string()
725 rc = of_property_count_strings(np, "unterminated-string-list"); in of_unittest_property_string()
729 rc = of_property_read_string_index(np, "string-property", 0, strings); in of_unittest_property_string()
732 rc = of_property_read_string_index(np, "string-property", 1, strings); in of_unittest_property_string()
734 rc = of_property_read_string_index(np, "phandle-list-names", 0, strings); in of_unittest_property_string()
736 rc = of_property_read_string_index(np, "phandle-list-names", 1, strings); in of_unittest_property_string()
738 rc = of_property_read_string_index(np, "phandle-list-names", 2, strings); in of_unittest_property_string()
741 rc = of_property_read_string_index(np, "phandle-list-names", 3, strings); in of_unittest_property_string()
744 rc = of_property_read_string_index(np, "unterminated-string", 0, strings); in of_unittest_property_string()
746 rc = of_property_read_string_index(np, "unterminated-string-list", 0, strings); in of_unittest_property_string()
749 rc = of_property_read_string_index(np, "unterminated-string-list", 2, strings); /* should fail */ in of_unittest_property_string()
754 rc = of_property_read_string_array(np, "string-property", strings, 4); in of_unittest_property_string()
756 rc = of_property_read_string_array(np, "phandle-list-names", strings, 4); in of_unittest_property_string()
758 rc = of_property_read_string_array(np, "unterminated-string", strings, 4); in of_unittest_property_string()
761 rc = of_property_read_string_array(np, "unterminated-string-list", strings, 4); in of_unittest_property_string()
765 rc = of_property_read_string_array(np, "unterminated-string-list", strings, 2); in of_unittest_property_string()
768 rc = of_property_read_string_array(np, "phandle-list-names", strings, 1); in of_unittest_property_string()
807 struct device_node *n1, *n2, *n21, *n22, *nchangeset, *nremove, *parent, *np; in of_unittest_changeset() local
882 unittest((np = of_find_node_by_path("/testcase-data/changeset/n2/n21")), in of_unittest_changeset()
884 of_node_put(np); in of_unittest_changeset()
885 unittest((np = of_find_node_by_path("/testcase-data/changeset/n2/n22")), in of_unittest_changeset()
887 of_node_put(np); in of_unittest_changeset()
913 struct device_node *np; in of_unittest_dma_get_max_cpu_address() local
919 np = of_find_node_by_path("/testcase-data/address-tests"); in of_unittest_dma_get_max_cpu_address()
920 if (!np) { in of_unittest_dma_get_max_cpu_address()
925 cpu_addr = of_dma_get_max_cpu_address(np); in of_unittest_dma_get_max_cpu_address()
935 struct device_node *np; in of_unittest_dma_ranges_one() local
939 np = of_find_node_by_path(path); in of_unittest_dma_ranges_one()
940 if (!np) { in of_unittest_dma_ranges_one()
945 rc = of_dma_get_range(np, &map); in of_unittest_dma_ranges_one()
947 unittest(!rc, "of_dma_get_range failed on node %pOF rc=%i\n", np, rc); in of_unittest_dma_ranges_one()
967 &paddr, expect_paddr, np); in of_unittest_dma_ranges_one()
970 &dma_addr, expect_dma_addr, np); in of_unittest_dma_ranges_one()
975 of_node_put(np); in of_unittest_dma_ranges_one()
992 struct device_node *np; in of_unittest_pci_dma_ranges() local
1000 np = of_find_node_by_path("/testcase-data/address-tests/pci@90000000"); in of_unittest_pci_dma_ranges()
1001 if (!np) { in of_unittest_pci_dma_ranges()
1006 if (of_pci_dma_range_parser_init(&parser, np)) { in of_unittest_pci_dma_ranges()
1018 np, range.size); in of_unittest_pci_dma_ranges()
1021 range.cpu_addr, np); in of_unittest_pci_dma_ranges()
1024 range.pci_addr, np); in of_unittest_pci_dma_ranges()
1028 np, range.size); in of_unittest_pci_dma_ranges()
1031 range.cpu_addr, np); in of_unittest_pci_dma_ranges()
1034 range.pci_addr, np); in of_unittest_pci_dma_ranges()
1039 of_node_put(np); in of_unittest_pci_dma_ranges()
1044 struct device_node *np; in of_unittest_bus_ranges() local
1050 np = of_find_node_by_path("/testcase-data/address-tests"); in of_unittest_bus_ranges()
1051 if (!np) { in of_unittest_bus_ranges()
1056 if (of_range_parser_init(&parser, np)) { in of_unittest_bus_ranges()
1061 ret = of_range_to_resource(np, 1, &res); in of_unittest_bus_ranges()
1063 ret, np); in of_unittest_bus_ranges()
1066 np, &res); in of_unittest_bus_ranges()
1069 np, &res); in of_unittest_bus_ranges()
1072 np, &res); in of_unittest_bus_ranges()
1077 np, count); in of_unittest_bus_ranges()
1085 np, range.flags, IORESOURCE_MEM); in of_unittest_bus_ranges()
1089 np, range.size); in of_unittest_bus_ranges()
1092 range.cpu_addr, np); in of_unittest_bus_ranges()
1095 range.pci_addr, np); in of_unittest_bus_ranges()
1099 np, range.size); in of_unittest_bus_ranges()
1102 range.cpu_addr, np); in of_unittest_bus_ranges()
1105 range.pci_addr, np); in of_unittest_bus_ranges()
1110 of_node_put(np); in of_unittest_bus_ranges()
1115 struct device_node *np; in of_unittest_bus_3cell_ranges() local
1120 np = of_find_node_by_path("/testcase-data/address-tests/bus@a0000000"); in of_unittest_bus_3cell_ranges()
1121 if (!np) { in of_unittest_bus_3cell_ranges()
1126 if (of_range_parser_init(&parser, np)) { in of_unittest_bus_3cell_ranges()
1138 np, range.flags); in of_unittest_bus_3cell_ranges()
1141 np, range.size); in of_unittest_bus_3cell_ranges()
1144 range.cpu_addr, np); in of_unittest_bus_3cell_ranges()
1147 range.pci_addr, np); in of_unittest_bus_3cell_ranges()
1151 np, range.flags); in of_unittest_bus_3cell_ranges()
1154 np, range.size); in of_unittest_bus_3cell_ranges()
1157 range.cpu_addr, np); in of_unittest_bus_3cell_ranges()
1160 range.pci_addr, np); in of_unittest_bus_3cell_ranges()
1165 of_node_put(np); in of_unittest_bus_3cell_ranges()
1170 struct device_node *np; in of_unittest_reg() local
1174 np = of_find_node_by_path("/testcase-data/address-tests/bus@80000000/device@1000"); in of_unittest_reg()
1175 if (!np) { in of_unittest_reg()
1180 ret = of_property_read_reg(np, 0, &addr, &size); in of_unittest_reg()
1182 np, ret); in of_unittest_reg()
1184 np, addr); in of_unittest_reg()
1186 of_node_put(np); in of_unittest_reg()
1191 struct device_node *np; in of_unittest_parse_interrupts() local
1198 np = of_find_node_by_path("/testcase-data/interrupts/interrupts0"); in of_unittest_parse_interrupts()
1199 if (!np) { in of_unittest_parse_interrupts()
1208 rc = of_irq_parse_one(np, i, &args); in of_unittest_parse_interrupts()
1215 i, args.np, rc); in of_unittest_parse_interrupts()
1217 of_node_put(np); in of_unittest_parse_interrupts()
1219 np = of_find_node_by_path("/testcase-data/interrupts/interrupts1"); in of_unittest_parse_interrupts()
1220 if (!np) { in of_unittest_parse_interrupts()
1229 rc = of_irq_parse_one(np, i, &args); in of_unittest_parse_interrupts()
1261 i, args.np, rc); in of_unittest_parse_interrupts()
1263 of_node_put(np); in of_unittest_parse_interrupts()
1268 struct device_node *np; in of_unittest_parse_interrupts_extended() local
1275 np = of_find_node_by_path("/testcase-data/interrupts/interrupts-extended0"); in of_unittest_parse_interrupts_extended()
1276 if (!np) { in of_unittest_parse_interrupts_extended()
1285 rc = of_irq_parse_one(np, i, &args); in of_unittest_parse_interrupts_extended()
1341 i, args.np, rc); in of_unittest_parse_interrupts_extended()
1343 of_node_put(np); in of_unittest_parse_interrupts_extended()
1383 struct device_node *np; in of_unittest_match_node() local
1388 np = of_find_node_by_path(match_node_tests[i].path); in of_unittest_match_node()
1389 if (!np) { in of_unittest_match_node()
1395 match = of_match_node(match_node_table, np); in of_unittest_match_node()
1419 struct device_node *np, *child, *grandchild; in of_unittest_platform_populate() local
1426 np = of_find_node_by_path("/testcase-data"); in of_unittest_platform_populate()
1427 of_platform_default_populate(np, NULL, NULL); in of_unittest_platform_populate()
1430 np = of_find_node_by_path("/testcase-data/testcase-device1"); in of_unittest_platform_populate()
1431 pdev = of_find_device_by_node(np); in of_unittest_platform_populate()
1440 np = of_find_node_by_path("/testcase-data/testcase-device2"); in of_unittest_platform_populate()
1441 pdev = of_find_device_by_node(np); in of_unittest_platform_populate()
1456 np = of_find_node_by_path("/testcase-data/platform-tests"); in of_unittest_platform_populate()
1457 unittest(np, "No testcase data in device tree\n"); in of_unittest_platform_populate()
1458 if (!np) in of_unittest_platform_populate()
1465 of_node_put(np); in of_unittest_platform_populate()
1468 test_bus->dev.of_node = np; in of_unittest_platform_populate()
1479 of_platform_populate(np, match, NULL, &test_bus->dev); in of_unittest_platform_populate()
1480 for_each_child_of_node(np, child) { in of_unittest_platform_populate()
1491 for_each_child_of_node(np, child) { in of_unittest_platform_populate()
1499 of_node_put(np); in of_unittest_platform_populate()
1504 * of np into dup node (present in live tree) and
1505 * updates parent of children of np to dup.
1507 * @np: node whose properties are being added to the live tree
1510 static void update_node_properties(struct device_node *np, in update_node_properties() argument
1518 for_each_child_of_node(np, child) in update_node_properties()
1538 for (prop = np->properties; prop != NULL; prop = save_next) { in update_node_properties()
1545 np, prop->name); in update_node_properties()
1553 * CAUTION: misleading function name - if node @np already exists in
1554 * the live tree then children of @np are *not* attached to the live
1558 * @np: Node to attach to live tree
1560 static void attach_node_and_children(struct device_node *np) in attach_node_and_children() argument
1566 full_name = kasprintf(GFP_KERNEL, "%pOF", np); in attach_node_and_children()
1579 update_node_properties(np, dup); in attach_node_and_children()
1583 child = np->child; in attach_node_and_children()
1584 np->child = NULL; in attach_node_and_children()
1588 np->sibling = np->parent->child; in attach_node_and_children()
1589 np->parent->child = np; in attach_node_and_children()
1590 of_node_clear_flag(np, OF_DETACHED); in attach_node_and_children()
1593 __of_attach_node_sysfs(np); in attach_node_and_children()
1611 struct device_node *unittest_data_node = NULL, *np; in unittest_data_add() local
1661 for_each_of_allnodes(np) in unittest_data_add()
1662 __of_attach_node_sysfs(np); in unittest_data_add()
1673 np = unittest_data_node->child; in unittest_data_add()
1674 while (np) { in unittest_data_add()
1675 struct device_node *next = np->sibling; in unittest_data_add()
1677 np->parent = of_root; in unittest_data_add()
1678 /* this will clear OF_DETACHED in np and children */ in unittest_data_add()
1679 attach_node_and_children(np); in unittest_data_add()
1680 np = next; in unittest_data_add()
1697 struct device_node *np = dev->of_node; in unittest_probe() local
1699 if (np == NULL) { in unittest_probe()
1705 dev_dbg(dev, "%s for node @%pOF\n", __func__, np); in unittest_probe()
1707 of_platform_populate(np, NULL, NULL, &pdev->dev); in unittest_probe()
1715 struct device_node *np = dev->of_node; in unittest_remove() local
1717 dev_dbg(dev, "%s for node @%pOF\n", __func__, np); in unittest_remove()
1737 struct device_node *np; in of_path_to_platform_device() local
1740 np = of_find_node_by_path(path); in of_path_to_platform_device()
1741 if (np == NULL) in of_path_to_platform_device()
1744 pdev = of_find_device_by_node(np); in of_path_to_platform_device()
1745 of_node_put(np); in of_path_to_platform_device()
1973 struct device_node *np; in of_path_to_i2c_client() local
1976 np = of_find_node_by_path(path); in of_path_to_i2c_client()
1977 if (np == NULL) in of_path_to_i2c_client()
1980 client = of_find_i2c_device_by_node(np); in of_path_to_i2c_client()
1981 of_node_put(np); in of_path_to_i2c_client()
2590 struct device_node *np = dev->of_node; in unittest_i2c_bus_probe() local
2595 if (np == NULL) { in unittest_i2c_bus_probe()
2601 dev_dbg(dev, "%s for node @%pOF\n", __func__, np); in unittest_i2c_bus_probe()
2634 struct device_node *np = dev->of_node; in unittest_i2c_bus_remove() local
2637 dev_dbg(dev, "%s for node @%pOF\n", __func__, np); in unittest_i2c_bus_remove()
2658 struct device_node *np = client->dev.of_node; in unittest_i2c_dev_probe() local
2660 if (!np) { in unittest_i2c_dev_probe()
2665 dev_dbg(dev, "%s for node @%pOF\n", __func__, np); in unittest_i2c_dev_probe()
2673 struct device_node *np = client->dev.of_node; in unittest_i2c_dev_remove() local
2675 dev_dbg(dev, "%s for node @%pOF\n", __func__, np); in unittest_i2c_dev_remove()
2704 struct device_node *np = client->dev.of_node, *child; in unittest_i2c_mux_probe() local
2708 dev_dbg(dev, "%s for node @%pOF\n", __func__, np); in unittest_i2c_mux_probe()
2710 if (!np) { in unittest_i2c_mux_probe()
2716 for_each_child_of_node(np, child) { in unittest_i2c_mux_probe()
2748 struct device_node *np = client->dev.of_node; in unittest_i2c_mux_remove() local
2751 dev_dbg(dev, "%s for node @%pOF\n", __func__, np); in unittest_i2c_mux_remove()
3147 struct device_node *np; in of_unittest_lifecycle() local
3163 np = of_find_node_by_path(refcount_path); in of_unittest_lifecycle()
3164 unittest(np, "find refcount_path \"%s\"\n", refcount_path); in of_unittest_lifecycle()
3165 if (np == NULL) in of_unittest_lifecycle()
3175 refcount = kref_read(&np->kobj.kref); in of_unittest_lifecycle()
3179 of_node_put(np); in of_unittest_lifecycle()
3190 of_node_put(np); in of_unittest_lifecycle()
3210 of_node_put(np); in of_unittest_lifecycle()
3227 of_node_put(np); in of_unittest_lifecycle()
3251 np = of_find_node_by_path(refcount_parent_path); in of_unittest_lifecycle()
3252 unittest(np, "find refcount_parent_path \"%s\"\n", refcount_parent_path); in of_unittest_lifecycle()
3253 unittest(np, "ERROR: devicetree live tree left in a 'bad state' if test fail\n"); in of_unittest_lifecycle()
3254 if (np == NULL) in of_unittest_lifecycle()
3257 prev_sibling = np->child; in of_unittest_lifecycle()
3260 np->child = next_sibling; in of_unittest_lifecycle()
3269 of_node_put(np); in of_unittest_lifecycle()
3534 struct device_node *np; in of_unittest_overlay_high_level() local
3565 for (np = overlay_base_root->child; np; np = np->sibling) { in of_unittest_overlay_high_level()
3566 if (of_node_name_eq(np, "__local_fixups__")) { in of_unittest_overlay_high_level()
3567 *pprev = np->sibling; in of_unittest_overlay_high_level()
3570 pprev = &np->sibling; in of_unittest_overlay_high_level()
3578 for (np = overlay_base_root->child; np; np = np->sibling) { in of_unittest_overlay_high_level()
3579 if (of_node_name_eq(np, "__symbols__")) { in of_unittest_overlay_high_level()
3580 overlay_base_symbols = np; in of_unittest_overlay_high_level()
3581 *pprev = np->sibling; in of_unittest_overlay_high_level()
3584 pprev = &np->sibling; in of_unittest_overlay_high_level()
3588 for_each_child_of_node(overlay_base_root, np) { in of_unittest_overlay_high_level()
3591 if (!strcmp(np->full_name, base_child->full_name)) { in of_unittest_overlay_high_level()
3593 np); in of_unittest_overlay_high_level()
3594 of_node_put(np); in of_unittest_overlay_high_level()
3609 for (np = overlay_base_root->child; np; np = np->sibling) in of_unittest_overlay_high_level()
3610 np->parent = of_root; in of_unittest_overlay_high_level()
3614 for (last_sibling = np = of_root->child; np; np = np->sibling) in of_unittest_overlay_high_level()
3615 last_sibling = np; in of_unittest_overlay_high_level()
3622 for_each_of_allnodes_from(overlay_base_root, np) in of_unittest_overlay_high_level()
3623 __of_attach_node_sysfs(np); in of_unittest_overlay_high_level()
3904 struct device_node *pnp, *np = NULL; in of_unittest_pci_node_verify() local
3917 np = of_find_node_by_path(path); in of_unittest_pci_node_verify()
3918 unittest(np, "Failed to get unittest-pci node under PCI node\n"); in of_unittest_pci_node_verify()
3919 if (!np) { in of_unittest_pci_node_verify()
3924 reg = of_get_property(np, "reg", NULL); in of_unittest_pci_node_verify()
3930 np = of_find_node_by_path(path); in of_unittest_pci_node_verify()
3931 unittest(!np, "Child device tree node is not removed\n"); in of_unittest_pci_node_verify()
3938 if (np) in of_unittest_pci_node_verify()
3939 of_node_put(np); in of_unittest_pci_node_verify()
3993 struct device_node *np; in of_unittest() local
4012 np = of_find_node_by_path("/testcase-data/phandle-tests/consumer-a"); in of_unittest()
4013 if (!np) { in of_unittest()
4017 of_node_put(np); in of_unittest()