From 14ca9f7f5abf7b94d71cfd466fb339bf64f58bda Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Mon, 27 Jan 2020 08:49:43 -0700 Subject: dm: core: Rename ofnode_get_chosen_prop() This function is actually intended to read a string rather than a property. All of its current callers use it that way. Also there is no way to return the length of the property from this function. Rename it to better indicate its purpose, using ofnode_read as the prefix since this matches most other functions. Also add some tests which are missing for these functions. Signed-off-by: Simon Glass --- arch/sandbox/dts/test.dts | 2 ++ 1 file changed, 2 insertions(+) (limited to 'arch/sandbox/dts/test.dts') diff --git a/arch/sandbox/dts/test.dts b/arch/sandbox/dts/test.dts index e529c54d8d..a04afd4076 100644 --- a/arch/sandbox/dts/test.dts +++ b/arch/sandbox/dts/test.dts @@ -813,6 +813,8 @@ chosen { #address-cells = <1>; #size-cells = <1>; + setting = "sunrise ohoka"; + other-node = "/some-bus/c-test@5"; chosen-test { compatible = "denx,u-boot-fdt-test"; reg = <9 1>; -- cgit From bd933bfd834364bca6cc6f3a62e4255090a5bec1 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Mon, 27 Jan 2020 08:49:46 -0700 Subject: dm: core: Add ofnode_get_chosen_prop() Add a function to read a property from the chosen node, providing access to its length. Update ofnode_get_chosen_string() to make use of it. Signed-off-by: Simon Glass --- arch/sandbox/dts/test.dts | 1 + 1 file changed, 1 insertion(+) (limited to 'arch/sandbox/dts/test.dts') diff --git a/arch/sandbox/dts/test.dts b/arch/sandbox/dts/test.dts index a04afd4076..347ea79077 100644 --- a/arch/sandbox/dts/test.dts +++ b/arch/sandbox/dts/test.dts @@ -815,6 +815,7 @@ #size-cells = <1>; setting = "sunrise ohoka"; other-node = "/some-bus/c-test@5"; + int-values = <0x1937 72993>; chosen-test { compatible = "denx,u-boot-fdt-test"; reg = <9 1>; -- cgit