summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUlrich Ölmann <u.oelmann@pengutronix.de>2018-12-18 14:57:26 +0100
committerRoland Hieber <rhi@pengutronix.de>2019-01-07 12:26:49 +0100
commita154e96beaf9eab52e58dd1df44195704bc2b27c (patch)
tree70d73fc0b762ef33e8aabbec399e32db5e157953
parent4b6a5658f3500a6e3097bc5585560aafdfafb12c (diff)
downloaddt-utils-a154e96beaf9eab52e58dd1df44195704bc2b27c.tar.gz
dt-utils-a154e96beaf9eab52e58dd1df44195704bc2b27c.tar.xz
treewide: Use of_property_write_string() where appropriate
This ports the following barebox commit: | commit b6089182316d831c3bfe0d96994df7e372a43c1b | Author: Sascha Hauer <s.hauer@pengutronix.de> | Date: Thu Mar 30 10:38:19 2017 +0200 | | treewide: Use of_property_write_string() where appropriate | | Replace users which use of_set_property() to set a property to a string | with of_property_write_string(). | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de> Signed-off-by: Roland Hieber <rhi@pengutronix.de>
-rw-r--r--src/barebox-state/state.c5
-rw-r--r--src/barebox-state/state_variables.c6
-rw-r--r--src/libdt.c2
3 files changed, 5 insertions, 8 deletions
diff --git a/src/barebox-state/state.c b/src/barebox-state/state.c
index e64111d..4adc065 100644
--- a/src/barebox-state/state.c
+++ b/src/barebox-state/state.c
@@ -285,9 +285,8 @@ static int state_convert_node_variable(struct state *state,
if ((conv == STATE_CONVERT_TO_NODE)
|| (conv == STATE_CONVERT_FIXUP)) {
- ret = of_set_property(new_node, "type",
- vtype->type_name,
- strlen(vtype->type_name) + 1, 1);
+ ret = of_property_write_string(new_node, "type",
+ vtype->type_name);
if (ret)
goto out;
diff --git a/src/barebox-state/state_variables.c b/src/barebox-state/state_variables.c
index fd072a0..cd42c2a 100644
--- a/src/barebox-state/state_variables.c
+++ b/src/barebox-state/state_variables.c
@@ -331,8 +331,7 @@ static int state_string_export(struct state_variable *var,
int ret = 0;
if (string->value_default) {
- ret = of_set_property(node, "default", string->value_default,
- strlen(string->value_default) + 1, 1);
+ ret = of_property_write_string(node, "default", string->value_default);
if (ret)
return ret;
@@ -342,8 +341,7 @@ static int state_string_export(struct state_variable *var,
return 0;
if (string->value)
- ret = of_set_property(node, "value", string->value,
- strlen(string->value) + 1, 1);
+ ret = of_property_write_string(node, "value", string->value);
return ret;
}
diff --git a/src/libdt.c b/src/libdt.c
index 8236a69..ded2916 100644
--- a/src/libdt.c
+++ b/src/libdt.c
@@ -1921,7 +1921,7 @@ int of_device_enable_path(const char *path)
*/
int of_device_disable(struct device_node *node)
{
- return of_set_property(node, "status", "disabled", sizeof("disabled"), 1);
+ return of_property_write_string(node, "status", "disabled");
}
/**