The of_new_property() function already has functionality to copy data into of_property so we can make of_property_write_u8_array() simpler. Signed-off-by: Antony Pavlov <antonynpavlov@xxxxxxxxx> --- drivers/of/base.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/of/base.c b/drivers/of/base.c index 6632f4d9dd..1161ce9793 100644 --- a/drivers/of/base.c +++ b/drivers/of/base.c @@ -1090,19 +1090,14 @@ int of_property_write_u8_array(struct device_node *np, size_t sz) { struct property *prop = of_find_property(np, propname, NULL); - u8 *val; if (prop) of_delete_property(prop); - prop = of_new_property(np, propname, NULL, sizeof(*val) * sz); + prop = of_new_property(np, propname, values, sizeof(*values) * sz); if (!prop) return -ENOMEM; - val = prop->value; - while (sz--) - *val++ = *values++; - return 0; } -- 2.11.0 _______________________________________________ barebox mailing list barebox@xxxxxxxxxxxxxxxxxxx http://lists.infradead.org/mailman/listinfo/barebox