mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Oleksij Rempel <o.rempel@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Oleksij Rempel <linux@rempel-privat.de>
Subject: [PATCH v3 2/3] of: base: don't try to read cells_name property if no cells_name set
Date: Mon, 23 Sep 2019 11:55:26 +0200	[thread overview]
Message-ID: <20190923095527.29174-3-o.rempel@pengutronix.de> (raw)
In-Reply-To: <20190923095527.29174-1-o.rempel@pengutronix.de>

From: Oleksij Rempel <linux@rempel-privat.de>

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>
---
 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 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);
-- 
2.23.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2019-09-23  9:55 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-23  9:55 [PATCH v3 0/3] remoteproc for barebox Oleksij Rempel
2019-09-23  9:55 ` [PATCH v3 1/3] elf: add missing elf32_shdr Oleksij Rempel
2019-09-23  9:55 ` Oleksij Rempel [this message]
2019-09-23  9:55 ` [PATCH v3 3/3] port reduced version of remoteproc framework from linux Oleksij Rempel
2019-09-26  6:43 ` [PATCH v3 0/3] remoteproc for barebox Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190923095527.29174-3-o.rempel@pengutronix.de \
    --to=o.rempel@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=linux@rempel-privat.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox