summaryrefslogtreecommitdiffstats
path: root/commands/of_property.c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2018-01-30 12:14:40 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2018-01-31 09:18:49 +0100
commitfb721e3fd2380d7d0835ad6479ee3a23b528569d (patch)
tree36b9ff1bdc30df7ce2efee5aa8b087990b477178 /commands/of_property.c
parent1f15703458fbd3d3c4cc53f8b7b6ace2be5eca46 (diff)
downloadbarebox-fb721e3fd2380d7d0835ad6479ee3a23b528569d.tar.gz
of: Allow for const properties
This adds support for const properties. We add a const void *value_const to struct property which will not be modified. The value of a property should no longer be used directly, but with the of_property_get_value() accessor which picks the right value. With this we can unflatten dtbs and use the property values directly from the dtb instead of copying them. This is useful for device trees which (ab)use properties to store huge data files, aka FIT images. To create a property whose value is not copied but used from the original input data we introduce of_new_property_const(). Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'commands/of_property.c')
-rw-r--r--commands/of_property.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/commands/of_property.c b/commands/of_property.c
index ae6bfd4..2bc08f2 100644
--- a/commands/of_property.c
+++ b/commands/of_property.c
@@ -278,6 +278,7 @@ static int do_of_property(int argc, char *argv[])
if (pp) {
free(pp->value);
+ pp->value_const = NULL;
/* limit property data to the actual size */
if (len) {