From f114b0479a2217c19cdf77a5aeeeb2a329255ff0 Mon Sep 17 00:00:00 2001 From: Oleksij Rempel Date: Mon, 23 Sep 2019 11:55:26 +0200 Subject: of: base: don't try to read cells_name property if no cells_name set Some device tree node parsed by of_count_phandle_with_args() have no #*-cells parameter. To make linux device trees work with barebox, we should accept cells_name set to NULL, so sync this behavior with linux. Signed-off-by: Oleksij Rempel Signed-off-by: Sascha Hauer --- drivers/of/base.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'drivers/of') diff --git a/drivers/of/base.c b/drivers/of/base.c index 838f530f85..d72c687ef3 100644 --- a/drivers/of/base.c +++ b/drivers/of/base.c @@ -1360,7 +1360,8 @@ static int __of_parse_phandle_with_args(const struct device_node *np, np->full_name); goto err; } - if (of_property_read_u32(node, cells_name, &count)) { + if (cells_name && + of_property_read_u32(node, cells_name, &count)) { pr_err("%s: could not get %s for %s\n", np->full_name, cells_name, node->full_name); -- cgit v1.2.3