[PATCH 1/3] dm: add cells_count parameter in *_count_phandle_with_args

Simon Glass sjg at chromium.org
Mon Oct 5 03:42:01 CEST 2020


On Fri, 25 Sep 2020 at 01:41, Patrick Delaunay <patrick.delaunay at st.com> wrote:
>
> 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 <patrick.delaunay at st.com>
> ---
> It is linked to previous serie [1] but it is not a blocking point today
> as no user use this API with cells_name = NULL
> + dev_count_phandle_with_args
> + ofnode_count_phandle_with_args
>
> [1/3] was Previously sent in RFC [2] + missing impacts in:
>   drivers/net/designware.c
>   drivers/power/domain/power-domain-uclass.c
>   drivers/usb/host/ohci-da8xx.c
>   drivers/usb/host/ohci-generic.c
>
> I also add test in [3/3] for modified API.
>
> But I think it is the good time to modify these functions as they are not
> hugely used.
>
> [1] http://patchwork.ozlabs.org/project/uboot/list/?series=200899
>     "dm: add cells_count parameter in live DT APIs of_parse_phandle_with_args"
> [2] http://patchwork.ozlabs.org/project/uboot/list/?series=200906&state=*
>
>
>  board/st/stm32mp1/stm32mp1.c               | 2 +-
>  drivers/clk/clk-uclass.c                   | 4 ++--
>  drivers/core/of_access.c                   | 7 ++++---
>  drivers/core/ofnode.c                      | 6 +++---
>  drivers/core/read.c                        | 5 +++--
>  drivers/net/designware.c                   | 3 ++-
>  drivers/phy/phy-uclass.c                   | 2 +-
>  drivers/power/domain/power-domain-uclass.c | 2 +-
>  drivers/reset/reset-uclass.c               | 2 +-
>  drivers/usb/host/ehci-generic.c            | 4 ++--
>  drivers/usb/host/ohci-da8xx.c              | 3 ++-
>  drivers/usb/host/ohci-generic.c            | 6 ++++--
>  include/dm/of_access.h                     | 4 +++-
>  include/dm/ofnode.h                        | 3 ++-
>  include/dm/read.h                          | 8 +++++---
>  15 files changed, 36 insertions(+), 25 deletions(-)

Reviewed-by: Simon Glass <sjg at chromium.org>


More information about the U-Boot mailing list