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
1192 np = of_find_node_by_path("/testcase-data/address-tests/bus@80000000/device@1000"); in of_unittest_reg()
1193 if (!np) { in of_unittest_reg()
1198 ret = of_property_read_reg(np, 0, &addr, &size); in of_unittest_reg()
1200 np, ret); in of_unittest_reg()
1202 np, addr); in of_unittest_reg()
1204 of_node_put(np); in of_unittest_reg()
1209 struct device_node *np; in of_unittest_parse_interrupts() local
1216 np = of_find_node_by_path("/testcase-data/interrupts/interrupts0"); in of_unittest_parse_interrupts()
1217 if (!np) { in of_unittest_parse_interrupts()
1226 rc = of_irq_parse_one(np, i, &args); in of_unittest_parse_interrupts()
1233 i, args.np, rc); in of_unittest_parse_interrupts()
1235 of_node_put(np); in of_unittest_parse_interrupts()
1237 np = of_find_node_by_path("/testcase-data/interrupts/interrupts1"); in of_unittest_parse_interrupts()
1238 if (!np) { in of_unittest_parse_interrupts()
1247 rc = of_irq_parse_one(np, i, &args); in of_unittest_parse_interrupts()
1279 i, args.np, rc); in of_unittest_parse_interrupts()
1281 of_node_put(np); in of_unittest_parse_interrupts()
1286 struct device_node *np; in of_unittest_parse_interrupts_extended() local
1293 np = of_find_node_by_path("/testcase-data/interrupts/interrupts-extended0"); in of_unittest_parse_interrupts_extended()
1294 if (!np) { in of_unittest_parse_interrupts_extended()
1303 rc = of_irq_parse_one(np, i, &args); in of_unittest_parse_interrupts_extended()
1359 i, args.np, rc); in of_unittest_parse_interrupts_extended()
1361 of_node_put(np); in of_unittest_parse_interrupts_extended()
1401 struct device_node *np; in of_unittest_match_node() local
1406 np = of_find_node_by_path(match_node_tests[i].path); in of_unittest_match_node()
1407 if (!np) { in of_unittest_match_node()
1413 match = of_match_node(match_node_table, np); in of_unittest_match_node()
1437 struct device_node *np, *child, *grandchild; in of_unittest_platform_populate() local
1444 np = of_find_node_by_path("/testcase-data"); in of_unittest_platform_populate()
1445 of_platform_default_populate(np, NULL, NULL); in of_unittest_platform_populate()
1448 np = of_find_node_by_path("/testcase-data/testcase-device1"); in of_unittest_platform_populate()
1449 pdev = of_find_device_by_node(np); in of_unittest_platform_populate()
1458 np = of_find_node_by_path("/testcase-data/testcase-device2"); in of_unittest_platform_populate()
1459 pdev = of_find_device_by_node(np); in of_unittest_platform_populate()
1474 np = of_find_node_by_path("/testcase-data/platform-tests"); in of_unittest_platform_populate()
1475 unittest(np, "No testcase data in device tree\n"); in of_unittest_platform_populate()
1476 if (!np) in of_unittest_platform_populate()
1483 of_node_put(np); in of_unittest_platform_populate()
1486 test_bus->dev.of_node = np; in of_unittest_platform_populate()
1497 of_platform_populate(np, match, NULL, &test_bus->dev); in of_unittest_platform_populate()
1498 for_each_child_of_node(np, child) { in of_unittest_platform_populate()
1509 for_each_child_of_node(np, child) { in of_unittest_platform_populate()
1517 of_node_put(np); in of_unittest_platform_populate()
1528 static void update_node_properties(struct device_node *np, in update_node_properties() argument
1536 for_each_child_of_node(np, child) in update_node_properties()
1556 for (prop = np->properties; prop != NULL; prop = save_next) { in update_node_properties()
1563 np, prop->name); in update_node_properties()
1578 static void attach_node_and_children(struct device_node *np) in attach_node_and_children() argument
1584 full_name = kasprintf(GFP_KERNEL, "%pOF", np); in attach_node_and_children()
1597 update_node_properties(np, dup); in attach_node_and_children()
1601 child = np->child; in attach_node_and_children()
1602 np->child = NULL; in attach_node_and_children()
1606 np->sibling = np->parent->child; in attach_node_and_children()
1607 np->parent->child = np; in attach_node_and_children()
1608 of_node_clear_flag(np, OF_DETACHED); in attach_node_and_children()
1611 __of_attach_node_sysfs(np); in attach_node_and_children()
1629 struct device_node *unittest_data_node = NULL, *np; in unittest_data_add() local
1679 for_each_of_allnodes(np) in unittest_data_add()
1680 __of_attach_node_sysfs(np); in unittest_data_add()
1691 np = unittest_data_node->child; in unittest_data_add()
1692 while (np) { in unittest_data_add()
1693 struct device_node *next = np->sibling; in unittest_data_add()
1695 np->parent = of_root; in unittest_data_add()
1697 attach_node_and_children(np); in unittest_data_add()
1698 np = next; in unittest_data_add()
1715 struct device_node *np = dev->of_node; in unittest_probe() local
1717 if (np == NULL) { in unittest_probe()
1723 dev_dbg(dev, "%s for node @%pOF\n", __func__, np); in unittest_probe()
1725 of_platform_populate(np, NULL, NULL, &pdev->dev); in unittest_probe()
1733 struct device_node *np = dev->of_node; in unittest_remove() local
1735 dev_dbg(dev, "%s for node @%pOF\n", __func__, np); in unittest_remove()
1755 struct device_node *np; in of_path_to_platform_device() local
1758 np = of_find_node_by_path(path); in of_path_to_platform_device()
1759 if (np == NULL) in of_path_to_platform_device()
1762 pdev = of_find_device_by_node(np); in of_path_to_platform_device()
1763 of_node_put(np); in of_path_to_platform_device()
1991 struct device_node *np; in of_path_to_i2c_client() local
1994 np = of_find_node_by_path(path); in of_path_to_i2c_client()
1995 if (np == NULL) in of_path_to_i2c_client()
1998 client = of_find_i2c_device_by_node(np); in of_path_to_i2c_client()
1999 of_node_put(np); in of_path_to_i2c_client()
2608 struct device_node *np = dev->of_node; in unittest_i2c_bus_probe() local
2613 if (np == NULL) { in unittest_i2c_bus_probe()
2619 dev_dbg(dev, "%s for node @%pOF\n", __func__, np); in unittest_i2c_bus_probe()
2652 struct device_node *np = dev->of_node; in unittest_i2c_bus_remove() local
2655 dev_dbg(dev, "%s for node @%pOF\n", __func__, np); in unittest_i2c_bus_remove()
2676 struct device_node *np = client->dev.of_node; in unittest_i2c_dev_probe() local
2678 if (!np) { in unittest_i2c_dev_probe()
2683 dev_dbg(dev, "%s for node @%pOF\n", __func__, np); in unittest_i2c_dev_probe()
2691 struct device_node *np = client->dev.of_node; in unittest_i2c_dev_remove() local
2693 dev_dbg(dev, "%s for node @%pOF\n", __func__, np); in unittest_i2c_dev_remove()
2722 struct device_node *np = client->dev.of_node, *child; in unittest_i2c_mux_probe() local
2726 dev_dbg(dev, "%s for node @%pOF\n", __func__, np); in unittest_i2c_mux_probe()
2728 if (!np) { in unittest_i2c_mux_probe()
2734 for_each_child_of_node(np, child) { in unittest_i2c_mux_probe()
2766 struct device_node *np = client->dev.of_node; in unittest_i2c_mux_remove() local
2769 dev_dbg(dev, "%s for node @%pOF\n", __func__, np); in unittest_i2c_mux_remove()
3165 struct device_node *np; in of_unittest_lifecycle() local
3181 np = of_find_node_by_path(refcount_path); in of_unittest_lifecycle()
3182 unittest(np, "find refcount_path \"%s\"\n", refcount_path); in of_unittest_lifecycle()
3183 if (np == NULL) in of_unittest_lifecycle()
3193 refcount = kref_read(&np->kobj.kref); in of_unittest_lifecycle()
3197 of_node_put(np); in of_unittest_lifecycle()
3208 of_node_put(np); in of_unittest_lifecycle()
3228 of_node_put(np); in of_unittest_lifecycle()
3245 of_node_put(np); in of_unittest_lifecycle()
3269 np = of_find_node_by_path(refcount_parent_path); in of_unittest_lifecycle()
3270 unittest(np, "find refcount_parent_path \"%s\"\n", refcount_parent_path); in of_unittest_lifecycle()
3271 unittest(np, "ERROR: devicetree live tree left in a 'bad state' if test fail\n"); in of_unittest_lifecycle()
3272 if (np == NULL) in of_unittest_lifecycle()
3275 prev_sibling = np->child; in of_unittest_lifecycle()
3278 np->child = next_sibling; in of_unittest_lifecycle()
3287 of_node_put(np); in of_unittest_lifecycle()
3552 struct device_node *np; in of_unittest_overlay_high_level() local
3583 for (np = overlay_base_root->child; np; np = np->sibling) { in of_unittest_overlay_high_level()
3584 if (of_node_name_eq(np, "__local_fixups__")) { in of_unittest_overlay_high_level()
3585 *pprev = np->sibling; in of_unittest_overlay_high_level()
3588 pprev = &np->sibling; in of_unittest_overlay_high_level()
3596 for (np = overlay_base_root->child; np; np = np->sibling) { in of_unittest_overlay_high_level()
3597 if (of_node_name_eq(np, "__symbols__")) { in of_unittest_overlay_high_level()
3598 overlay_base_symbols = np; 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()
3606 for_each_child_of_node(overlay_base_root, np) { in of_unittest_overlay_high_level()
3609 if (!strcmp(np->full_name, base_child->full_name)) { in of_unittest_overlay_high_level()
3611 np); in of_unittest_overlay_high_level()
3612 of_node_put(np); in of_unittest_overlay_high_level()
3627 for (np = overlay_base_root->child; np; np = np->sibling) in of_unittest_overlay_high_level()
3628 np->parent = of_root; in of_unittest_overlay_high_level()
3632 for (last_sibling = np = of_root->child; np; np = np->sibling) in of_unittest_overlay_high_level()
3633 last_sibling = np; in of_unittest_overlay_high_level()
3640 for_each_of_allnodes_from(overlay_base_root, np) in of_unittest_overlay_high_level()
3641 __of_attach_node_sysfs(np); in of_unittest_overlay_high_level()
3922 struct device_node *pnp, *np = NULL; in of_unittest_pci_node_verify() local
3935 np = of_find_node_by_path(path); in of_unittest_pci_node_verify()
3936 unittest(np, "Failed to get unittest-pci node under PCI node\n"); in of_unittest_pci_node_verify()
3937 if (!np) { in of_unittest_pci_node_verify()
3942 reg = of_get_property(np, "reg", NULL); in of_unittest_pci_node_verify()
3948 np = of_find_node_by_path(path); in of_unittest_pci_node_verify()
3949 unittest(!np, "Child device tree node is not removed\n"); in of_unittest_pci_node_verify()
3956 if (np) in of_unittest_pci_node_verify()
3957 of_node_put(np); in of_unittest_pci_node_verify()
4011 struct device_node *np; in of_unittest() local
4030 np = of_find_node_by_path("/testcase-data/phandle-tests/consumer-a"); in of_unittest()
4031 if (!np) { in of_unittest()
4035 of_node_put(np); in of_unittest()