[U-Boot] [PATCH v3 1/4] core: Add functions to set properties in live-tree

Simon Glass sjg at chromium.org
Tue Jun 26 23:18:06 UTC 2018


On 26 June 2018 at 00:46, Mario Six <mario.six at gdsys.cc> wrote:
> Implement a set of functions to manipulate properties in a live device
> tree:
>
> * ofnode_write_prop() to set generic properties of a node
> * ofnode_write_string() to set string properties of a node
> * ofnode_set_enabled() to either enable or disable a node
>
> Signed-off-by: Mario Six <mario.six at gdsys.cc>
>
> ---
>
> v2 -> v3:
> * Removed #ifdef, and used if (!of_live_active()) instead
> * Removed allocation of property value (caller is now responsible for
>   that); this also fixes a potential memory leak
> * Added error handling for malloc and strdup
> * Fixed style violations
>
> v1 -> v2:
> * Fix potential NULL pointer dereference in ofnode_write_property
> * Squashed the enable/disable functions into one
> * Renamed ofnode_set_property to ofnode_write_prop
>
> ---
>  drivers/core/ofnode.c | 70 +++++++++++++++++++++++++++++++++++++++++++++++++++
>  include/dm/ofnode.h   | 46 +++++++++++++++++++++++++++++++++
>  2 files changed, 116 insertions(+)

Reviewed-by: Simon Glass <sjg at chromium.org>


More information about the U-Boot mailing list