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/net/designware.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'drivers/net/designware.c') diff --git a/drivers/net/designware.c b/drivers/net/designware.c index 1c0e8294078..4c19abbaf0c 100644 --- a/drivers/net/designware.c +++ b/drivers/net/designware.c @@ -688,7 +688,8 @@ int designware_eth_probe(struct udevice *dev) int i, clock_nb; priv->clock_count = 0; - clock_nb = dev_count_phandle_with_args(dev, "clocks", "#clock-cells"); + clock_nb = dev_count_phandle_with_args(dev, "clocks", "#clock-cells", + 0); if (clock_nb > 0) { priv->clocks = devm_kcalloc(dev, clock_nb, sizeof(struct clk), GFP_KERNEL); -- cgit v1.2.3