]> git.baikalelectronics.ru Git - uboot.git/commit
dm: core: Allow copying ofnode property data when writing
authorSimon Glass <sjg@chromium.org>
Wed, 7 Sep 2022 02:27:32 +0000 (20:27 -0600)
committerTom Rini <trini@konsulko.com>
Fri, 30 Sep 2022 02:43:43 +0000 (22:43 -0400)
commit899a944d687521f48fc09e5dabccb9a57924e039
tree2cfa68b6cbd711ec4ec34e92aa1320930e6a8fd4
parentc457300f2919746bc6a2da20f1d871071a20a2c4
dm: core: Allow copying ofnode property data when writing

At present ofnode_write_prop() is inconsistent between livetree and
flattree, in that livetree requires the caller to ensure the property
value is stable (e.g. in rodata or allocated) but flattree does not, since
it makes a copy.

This makes the API call a bit painful to use, since the caller must do
different things depending on OF_LIVE.

Add a new 'copy' argument which tells the function to make a copy if
needed. Add some tests to cover this behaviour.

Signed-off-by: Simon Glass <sjg@chromium.org>
doc/develop/driver-model/livetree.rst
drivers/core/ofnode.c
include/dm/ofnode.h
test/dm/ofnode.c