[U-Boot] [PATCH v10 04/10] dm: core: add ofnode_count_phandle_with_args()
Simon Glass
sjg at chromium.org
Fri Jul 7 03:57:05 UTC 2017
On 6 July 2017 at 01:42, <patrice.chotard at st.com> wrote:
> From: Patrice Chotard <patrice.chotard at st.com>
>
> This function is usefull to get phandle number contained
> in a property list.
> For example, this allows to allocate the right amount
> of memory to keep clock's reference contained into the
> "clocks" property.
>
> To implement it, either of_count_phandle_with_args() or
> fdtdec_parse_phandle_with_args() are used respectively
> for live tree and flat tree.
> By passing index = -1, these 2 functions returns the
> number of phandle contained into the property list.
>
> Add also the dev_count_phandle_with_args() based on
> ofnode_count_phandle_with_args()
>
> Signed-off-by: Patrice Chotard <patrice.chotard at st.com>
> ---
>
> v10: _ add dev_count_phandle_with_args() requested by Simon Glass
> v9: _ none
> v8: _ none
> v7: _ add ofnode_count_phandle_with_args() which returns
> the phandle number contained into a property list.
> drivers/core/of_access.c | 7 +++++++
> drivers/core/ofnode.c | 12 ++++++++++++
> include/dm/of_access.h | 18 ++++++++++++++++++
> include/dm/ofnode.h | 17 +++++++++++++++++
> include/dm/read.h | 25 +++++++++++++++++++++++++
> 5 files changed, 79 insertions(+)
Reviewed-by: Simon Glass <sjg at chromium.org>
More information about the U-Boot
mailing list