From 89f68302cacaa41330959420d7329b7c89afdd88 Mon Sep 17 00:00:00 2001 From: Patrick Delaunay Date: Fri, 25 Sep 2020 09:41:14 +0200 Subject: dm: add cells_count parameter in *_count_phandle_with_args The cell_count argument is required when cells_name is NULL. This patch adds this parameter in live tree API - of_count_phandle_with_args - ofnode_count_phandle_with_args - dev_count_phandle_with_args This parameter solves issue when these API is used to count the number of element of a cell without cell name. This parameter allow to force the size cell. For example: count = dev_count_phandle_with_args(dev, "array", NULL, 3); Signed-off-by: Patrick Delaunay Reviewed-by: Simon Glass --- drivers/core/ofnode.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'drivers/core/ofnode.c') diff --git a/drivers/core/ofnode.c b/drivers/core/ofnode.c index 79fcdf5ce21..7d1b89514c7 100644 --- a/drivers/core/ofnode.c +++ b/drivers/core/ofnode.c @@ -432,15 +432,15 @@ int ofnode_parse_phandle_with_args(ofnode node, const char *list_name, } int ofnode_count_phandle_with_args(ofnode node, const char *list_name, - const char *cells_name) + const char *cells_name, int cell_count) { if (ofnode_is_np(node)) return of_count_phandle_with_args(ofnode_to_np(node), - list_name, cells_name); + list_name, cells_name, cell_count); else return fdtdec_parse_phandle_with_args(gd->fdt_blob, ofnode_to_offset(node), list_name, cells_name, - 0, -1, NULL); + cell_count, -1, NULL); } ofnode ofnode_path(const char *path) -- cgit v1.2.3