From mboxrd@z Thu Jan 1 00:00:00 1970 From: Simon Glass Date: Sun, 4 Oct 2020 19:42:01 -0600 Subject: [PATCH 1/3] dm: add cells_count parameter in *_count_phandle_with_args In-Reply-To: <20200925074116.16068-1-patrick.delaunay@st.com> References: <20200925074116.16068-1-patrick.delaunay@st.com> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Fri, 25 Sep 2020 at 01:41, Patrick Delaunay 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 > --- > 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