Lines Matching refs:rc

242 	int count = 0, rc;
251 rc = of_unittest_check_node_linkage(child);
252 if (rc < 0)
253 return rc;
254 count += rc;
395 int i, rc;
403 rc = of_count_phandle_with_args(np, "phandle-list", "#phandle-cells");
404 unittest(rc == 7, "of_count_phandle_with_args() returned %i, expected 7\n", rc);
410 rc = of_parse_phandle_with_args(np, "phandle-list",
416 passed &= !rc;
421 passed &= !rc;
427 passed &= (rc == -ENOENT);
430 passed &= !rc;
437 passed &= !rc;
443 passed &= !rc;
447 passed &= !rc;
452 passed &= (rc == -ENOENT);
458 unittest(passed, "index %i - data error on node %pOF rc=%i\n",
459 i, args.np, rc);
461 if (rc == 0)
467 rc = of_parse_phandle_with_args(np, "phandle-list-missing",
469 unittest(rc == -ENOENT, "expected:%i got:%i\n", -ENOENT, rc);
470 rc = of_count_phandle_with_args(np, "phandle-list-missing",
472 unittest(rc == -ENOENT, "expected:%i got:%i\n", -ENOENT, rc);
480 rc = of_parse_phandle_with_args(np, "phandle-list",
486 unittest(rc == -EINVAL, "expected:%i got:%i\n", -EINVAL, rc);
491 rc = of_count_phandle_with_args(np, "phandle-list",
497 unittest(rc == -EINVAL, "expected:%i got:%i\n", -EINVAL, rc);
505 rc = of_parse_phandle_with_args(np, "phandle-list-bad-phandle",
511 unittest(rc == -EINVAL, "expected:%i got:%i\n", -EINVAL, rc);
516 rc = of_count_phandle_with_args(np, "phandle-list-bad-phandle",
522 unittest(rc == -EINVAL, "expected:%i got:%i\n", -EINVAL, rc);
530 rc = of_parse_phandle_with_args(np, "phandle-list-bad-args",
536 unittest(rc == -EINVAL, "expected:%i got:%i\n", -EINVAL, rc);
541 rc = of_count_phandle_with_args(np, "phandle-list-bad-args",
547 unittest(rc == -EINVAL, "expected:%i got:%i\n", -EINVAL, rc);
555 int i, rc;
577 rc = of_count_phandle_with_args(np, "phandle-list", "#phandle-cells");
578 unittest(rc == 8, "of_count_phandle_with_args() returned %i, expected 8\n", rc);
584 rc = of_parse_phandle_with_args_map(np, "phandle-list",
590 passed &= !rc;
596 passed &= !rc;
604 passed &= (rc == -ENOENT);
607 passed &= !rc;
612 passed &= !rc;
618 passed &= !rc;
623 passed &= !rc;
630 passed &= !rc;
638 passed &= (rc == -ENOENT);
644 unittest(passed, "index %i - data error on node %s rc=%i\n",
645 i, args.np->full_name, rc);
647 if (rc == 0)
653 rc = of_parse_phandle_with_args_map(np, "phandle-list-missing",
655 unittest(rc == -ENOENT, "expected:%i got:%i\n", -ENOENT, rc);
663 rc = of_parse_phandle_with_args_map(np, "phandle-list",
668 unittest(rc == -EINVAL, "expected:%i got:%i\n", -EINVAL, rc);
676 rc = of_parse_phandle_with_args_map(np, "phandle-list-bad-phandle",
681 unittest(rc == -EINVAL, "expected:%i got:%i\n", -EINVAL, rc);
689 rc = of_parse_phandle_with_args_map(np, "phandle-list-bad-args",
694 unittest(rc == -EINVAL, "expected:%i got:%i\n", -EINVAL, rc);
708 int rc;
716 rc = of_property_match_string(np, "phandle-list-names", "first");
717 unittest(rc == 0, "first expected:0 got:%i\n", rc);
718 rc = of_property_match_string(np, "phandle-list-names", "second");
719 unittest(rc == 1, "second expected:1 got:%i\n", rc);
720 rc = of_property_match_string(np, "phandle-list-names", "third");
721 unittest(rc == 2, "third expected:2 got:%i\n", rc);
722 rc = of_property_match_string(np, "phandle-list-names", "fourth");
723 unittest(rc == -ENODATA, "unmatched string; rc=%i\n", rc);
724 rc = of_property_match_string(np, "missing-property", "blah");
725 unittest(rc == -EINVAL, "missing property; rc=%i\n", rc);
726 rc = of_property_match_string(np, "empty-property", "blah");
727 unittest(rc == -ENODATA, "empty property; rc=%i\n", rc);
728 rc = of_property_match_string(np, "unterminated-string", "blah");
729 unittest(rc == -EILSEQ, "unterminated string; rc=%i\n", rc);
732 rc = of_property_count_strings(np, "string-property");
733 unittest(rc == 1, "Incorrect string count; rc=%i\n", rc);
734 rc = of_property_count_strings(np, "phandle-list-names");
735 unittest(rc == 3, "Incorrect string count; rc=%i\n", rc);
736 rc = of_property_count_strings(np, "unterminated-string");
737 unittest(rc == -EILSEQ, "unterminated string; rc=%i\n", rc);
738 rc = of_property_count_strings(np, "unterminated-string-list");
739 unittest(rc == -EILSEQ, "unterminated string array; rc=%i\n", rc);
742 rc = of_property_read_string_index(np, "string-property", 0, strings);
743 unittest(rc == 0 && !strcmp(strings[0], "foobar"), "of_property_read_string_index() failure; rc=%i\n", rc);
745 rc = of_property_read_string_index(np, "string-property", 1, strings);
746 unittest(rc == -ENODATA && strings[0] == NULL, "of_property_read_string_index() failure; rc=%i\n", rc);
747 rc = of_property_read_string_index(np, "phandle-list-names", 0, strings);
748 unittest(rc == 0 && !strcmp(strings[0], "first"), "of_property_read_string_index() failure; rc=%i\n", rc);
749 rc = of_property_read_string_index(np, "phandle-list-names", 1, strings);
750 unittest(rc == 0 && !strcmp(strings[0], "second"), "of_property_read_string_index() failure; rc=%i\n", rc);
751 rc = of_property_read_string_index(np, "phandle-list-names", 2, strings);
752 unittest(rc == 0 && !strcmp(strings[0], "third"), "of_property_read_string_index() failure; rc=%i\n", rc);
754 rc = of_property_read_string_index(np, "phandle-list-names", 3, strings);
755 unittest(rc == -ENODATA && strings[0] == NULL, "of_property_read_string_index() failure; rc=%i\n", rc);
757 rc = of_property_read_string_index(np, "unterminated-string", 0, strings);
758 unittest(rc == -EILSEQ && strings[0] == NULL, "of_property_read_string_index() failure; rc=%i\n", rc);
759 rc = of_property_read_string_index(np, "unterminated-string-list", 0, strings);
760 unittest(rc == 0 && !strcmp(strings[0], "first"), "of_property_read_string_index() failure; rc=%i\n", rc);
762 rc = of_property_read_string_index(np, "unterminated-string-list", 2, strings); /* should fail */
763 unittest(rc == -EILSEQ && strings[0] == NULL, "of_property_read_string_index() failure; rc=%i\n", rc);
767 rc = of_property_read_string_array(np, "string-property", strings, 4);
768 unittest(rc == 1, "Incorrect string count; rc=%i\n", rc);
769 rc = of_property_read_string_array(np, "phandle-list-names", strings, 4);
770 unittest(rc == 3, "Incorrect string count; rc=%i\n", rc);
771 rc = of_property_read_string_array(np, "unterminated-string", strings, 4);
772 unittest(rc == -EILSEQ, "unterminated string; rc=%i\n", rc);
774 rc = of_property_read_string_array(np, "unterminated-string-list", strings, 4);
775 unittest(rc == -EILSEQ, "unterminated string array; rc=%i\n", rc);
778 rc = of_property_read_string_array(np, "unterminated-string-list", strings, 2);
779 unittest(rc == 2 && strings[2] == NULL, "of_property_read_string_array() failure; rc=%i\n", rc);
781 rc = of_property_read_string_array(np, "phandle-list-names", strings, 1);
782 unittest(rc == 1 && strings[1] == NULL, "Overwrote end of string array; rc=%i, str='%s'\n", rc, strings[1]);
946 int rc;
954 rc = of_dma_get_range(np, &map);
956 unittest(!rc, "of_dma_get_range failed on node %pOF rc=%i\n", np, rc);
958 if (!rc) {
1278 int i, rc;
1293 rc = of_irq_parse_one(np, i, &args);
1295 passed &= !rc;
1299 unittest(passed, "index %i - data error on node %pOF rc=%i\n",
1300 i, args.np, rc);
1314 rc = of_irq_parse_one(np, i, &args);
1319 passed &= !rc;
1324 passed &= !rc;
1331 passed &= !rc;
1337 passed &= !rc;
1345 unittest(passed, "index %i - data error on node %pOF rc=%i\n",
1346 i, args.np, rc);
1355 int i, rc;
1370 rc = of_irq_parse_one(np, i, &args);
1375 passed &= !rc;
1380 passed &= !rc;
1387 passed &= !rc;
1393 passed &= !rc;
1398 passed &= !rc;
1405 passed &= !rc;
1417 passed &= !rc;
1425 unittest(passed, "index %i - data error on node %pOF rc=%i\n",
1426 i, args.np, rc);
1503 int irq, rc;
1547 rc = PTR_ERR_OR_ZERO(test_bus);
1548 unittest(!rc, "testbus registration failed; rc=%i\n", rc);
1549 if (rc) {
1704 int rc;
1737 rc = of_resolve_phandles(unittest_data_node);
1738 if (rc) {
1739 pr_err("%s: Failed to resolve phandles (rc=%i)\n", __func__, rc);
3987 int rc = 0;
3999 rc = -ENODEV;
4006 rc = -ENODEV;
4020 return rc;
4026 int rc;
4031 rc = pci_register_driver(&testdrv_driver);
4032 unittest(!rc, "Failed to register pci test driver; rc = %d\n", rc);
4033 if (rc)
4036 rc = platform_driver_register(&unittest_pci_driver);
4037 if (unittest(!rc, "Failed to register unittest pci driver\n")) {