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 <[email protected]>
---
 drivers/of/base.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/of/base.c b/drivers/of/base.c
index 838f530f8..d72c687ef 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);
--
2.20.1


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

Reply via email to