
27 Jun
2018
27 Jun
'18
1:18 a.m.
On 26 June 2018 at 00:46, Mario Six mario.six@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@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@chromium.org