aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMaxime Ripard2016-07-05 10:26:43 +0200
committerTom Rini2016-08-20 11:35:04 -0400
commitea7b1a213e8b01befd05d94620add7cf84883876 (patch)
treec13650677e4b097ae9eb4dc5468745975086e51d /include
parent2b941bf96dd66a5730f1dcbcb635e28930aa58fa (diff)
libfdt: Add fdt_setprop_inplace_namelen_partial
Add a function to modify inplace only a portion of a property.. This is especially useful when the property is an array of values, and you want to update one of them without changing the DT size. Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com> Acked-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include')
-rw-r--r--include/libfdt.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/include/libfdt.h b/include/libfdt.h
index a55d2d0d8c7..4c56711c713 100644
--- a/include/libfdt.h
+++ b/include/libfdt.h
@@ -1054,6 +1054,27 @@ int fdt_size_cells(const void *fdt, int nodeoffset);
/**********************************************************************/
/**
+ * fdt_setprop_inplace_namelen_partial - change a property's value,
+ * but not its size
+ * @fdt: pointer to the device tree blob
+ * @nodeoffset: offset of the node whose property to change
+ * @name: name of the property to change
+ * @namelen: number of characters of name to consider
+ * @index: index of the property to change in the array
+ * @val: pointer to data to replace the property value with
+ * @len: length of the property value
+ *
+ * Identical to fdt_setprop_inplace(), but modifies the given property
+ * starting from the given index, and using only the first characters
+ * of the name. It is useful when you want to manipulate only one value of
+ * an array and you have a string that doesn't end with \0.
+ */
+int fdt_setprop_inplace_namelen_partial(void *fdt, int nodeoffset,
+ const char *name, int namelen,
+ uint32_t index, const void *val,
+ int len);
+
+/**
* fdt_setprop_inplace - change a property's value, but not its size
* @fdt: pointer to the device tree blob
* @nodeoffset: offset of the node whose property to change