summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOleksij Rempel <linux@rempel-privat.de>2019-09-23 11:55:26 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2019-09-26 08:42:52 +0200
commitf114b0479a2217c19cdf77a5aeeeb2a329255ff0 (patch)
tree592e86a9ceb78e75d53b036ad0b0597927479bd4
parent22ea5e5f57f19be04e0a10aecd82960af2ff719f (diff)
downloadbarebox-f114b0479a2217c19cdf77a5aeeeb2a329255ff0.tar.gz
barebox-f114b0479a2217c19cdf77a5aeeeb2a329255ff0.tar.xz
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 <linux@rempel-privat.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--drivers/of/base.c3
1 files changed, 2 insertions, 1 deletions
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);