Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

of: unittest: Add a test case for of_changeset_add_prop_bool()

Improve of_unittest_changeset_prop() to have a test case for the
newly introduced of_changeset_add_prop_bool().

Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Link: https://lore.kernel.org/r/20240527161450.326615-17-herve.codina@bootlin.com
Signed-off-by: Rob Herring (Arm) <robh@kernel.org>

authored by

Herve Codina and committed by
Rob Herring (Arm)
1e436839 f2b388d6

+11
+11
drivers/of/unittest.c
··· 1009 1009 } 1010 1010 } 1011 1011 1012 + static void __init __maybe_unused changeset_check_bool(struct device_node *np, 1013 + const char *prop_name) 1014 + { 1015 + unittest(of_property_read_bool(np, prop_name), 1016 + "%s value mismatch (read 'false', exp 'true')\n", prop_name); 1017 + } 1018 + 1012 1019 static void __init of_unittest_changeset_prop(void) 1013 1020 { 1014 1021 #ifdef CONFIG_OF_DYNAMIC ··· 1051 1044 u32_array, ARRAY_SIZE(u32_array)); 1052 1045 unittest(ret == 0, "failed to add prop-u32-array\n"); 1053 1046 1047 + ret = of_changeset_add_prop_bool(&chgset, np, "prop-bool"); 1048 + unittest(ret == 0, "failed to add prop-bool\n"); 1049 + 1054 1050 of_node_put(np); 1055 1051 1056 1052 ret = of_changeset_apply(&chgset); ··· 1068 1058 changeset_check_string_array(np, "prop-string-array", str_array, ARRAY_SIZE(str_array)); 1069 1059 changeset_check_u32(np, "prop-u32", 1234); 1070 1060 changeset_check_u32_array(np, "prop-u32-array", u32_array, ARRAY_SIZE(u32_array)); 1061 + changeset_check_bool(np, "prop-bool"); 1071 1062 1072 1063 of_node_put(np); 1073 1064