|
@@ -36,6 +36,9 @@ static void __init of_selftest_parse_phandle_with_args(void)
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
+ rc = of_count_phandle_with_args(np, "phandle-list", "#phandle-cells");
|
|
|
+ selftest(rc == 7, "of_count_phandle_with_args() returned %i, expected 7\n", rc);
|
|
|
+
|
|
|
for (i = 0; i < 8; i++) {
|
|
|
bool passed = true;
|
|
|
rc = of_parse_phandle_with_args(np, "phandle-list",
|
|
@@ -94,21 +97,33 @@ static void __init of_selftest_parse_phandle_with_args(void)
|
|
|
rc = of_parse_phandle_with_args(np, "phandle-list-missing",
|
|
|
"#phandle-cells", 0, &args);
|
|
|
selftest(rc == -ENOENT, "expected:%i got:%i\n", -ENOENT, rc);
|
|
|
+ rc = of_count_phandle_with_args(np, "phandle-list-missing",
|
|
|
+ "#phandle-cells");
|
|
|
+ selftest(rc == -ENOENT, "expected:%i got:%i\n", -ENOENT, rc);
|
|
|
|
|
|
/* Check for missing cells property */
|
|
|
rc = of_parse_phandle_with_args(np, "phandle-list",
|
|
|
"#phandle-cells-missing", 0, &args);
|
|
|
selftest(rc == -EINVAL, "expected:%i got:%i\n", -EINVAL, rc);
|
|
|
+ rc = of_count_phandle_with_args(np, "phandle-list",
|
|
|
+ "#phandle-cells-missing");
|
|
|
+ selftest(rc == -EINVAL, "expected:%i got:%i\n", -EINVAL, rc);
|
|
|
|
|
|
/* Check for bad phandle in list */
|
|
|
rc = of_parse_phandle_with_args(np, "phandle-list-bad-phandle",
|
|
|
"#phandle-cells", 0, &args);
|
|
|
selftest(rc == -EINVAL, "expected:%i got:%i\n", -EINVAL, rc);
|
|
|
+ rc = of_count_phandle_with_args(np, "phandle-list-bad-phandle",
|
|
|
+ "#phandle-cells");
|
|
|
+ selftest(rc == -EINVAL, "expected:%i got:%i\n", -EINVAL, rc);
|
|
|
|
|
|
/* Check for incorrectly formed argument list */
|
|
|
rc = of_parse_phandle_with_args(np, "phandle-list-bad-args",
|
|
|
"#phandle-cells", 1, &args);
|
|
|
selftest(rc == -EINVAL, "expected:%i got:%i\n", -EINVAL, rc);
|
|
|
+ rc = of_count_phandle_with_args(np, "phandle-list-bad-args",
|
|
|
+ "#phandle-cells");
|
|
|
+ selftest(rc == -EINVAL, "expected:%i got:%i\n", -EINVAL, rc);
|
|
|
}
|
|
|
|
|
|
static void __init of_selftest_property_match_string(void)
|