mirror of
https://github.com/dgibson/dtc.git
synced 2025-10-13 16:27:39 -04:00
libfdt: Add fdt_setprop_empty()
Device trees can contain empty (zero length) properties, which are often used as boolean flags. These can already be created using fdt_setprop() passing a length of zero and a pointer which is ignored. It is safe to pass NULL, but that may not be obvious from the interface. To make it clearer, add an fdt_setprop_empty() helper macro. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
parent
69a1bd6ad3
commit
397d5ef020
2 changed files with 31 additions and 1 deletions
|
@ -66,7 +66,7 @@ int main(int argc, char *argv[])
|
|||
TEST_STRING_1);
|
||||
|
||||
verbose_printf("Old string value was \"%s\"\n", strp);
|
||||
err = fdt_setprop(fdt, 0, "prop-str", NULL, 0);
|
||||
err = fdt_setprop_empty(fdt, 0, "prop-str");
|
||||
if (err)
|
||||
FAIL("Failed to empty \"prop-str\": %s",
|
||||
fdt_strerror(err));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue