mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Barebox List <barebox@lists.infradead.org>
Subject: [PATCH 4/5] of: platform: Change of_devices_ensure_probed_by_property() return value
Date: Tue,  8 Mar 2022 12:51:02 +0100	[thread overview]
Message-ID: <20220308115103.3664883-5-s.hauer@pengutronix.de> (raw)
In-Reply-To: <20220308115103.3664883-1-s.hauer@pengutronix.de>

of_devices_ensure_probed_by_property() returns with an error immediately
when one the calls to of_device_ensure_probed() fails. This is not the
desired behaviour. Instead, always call of_device_ensure_probed() on all
found nodes and return unsuccessfully when at least one of the nodes
failed.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/of/platform.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/of/platform.c b/drivers/of/platform.c
index f22c5f2e76..4e96350ae2 100644
--- a/drivers/of/platform.c
+++ b/drivers/of/platform.c
@@ -514,16 +514,15 @@ EXPORT_SYMBOL_GPL(of_devices_ensure_probed_by_dev_id);
 int of_devices_ensure_probed_by_property(const char *property_name)
 {
 	struct device_node *node;
+	int err, ret = 0;
 
 	if (!deep_probe_is_supported())
 		return 0;
 
 	for_each_node_with_property(node, property_name) {
-		int ret;
-
 		ret = of_device_ensure_probed(node);
-		if (ret)
-			return ret;
+		if (err)
+			ret = err;
 	}
 
 	return 0;
-- 
2.30.2


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


  parent reply	other threads:[~2022-03-08 11:52 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-08 11:50 [PATCH 0/5] of: platform: deep probe updates Sascha Hauer
2022-03-08 11:50 ` [PATCH 1/5] of: platform: return early when deep probe is not supported Sascha Hauer
2022-03-08 11:51 ` [PATCH 2/5] of: rename of_find_node_by_name() to of_find_node_by_name_address() Sascha Hauer
2022-03-08 11:51 ` [PATCH 3/5] of: Add of_find_node_by_name() with Linux semantics Sascha Hauer
2022-03-08 11:51 ` Sascha Hauer [this message]
2022-03-08 11:51 ` [PATCH 5/5] of: platform: Ensure timers are probed early 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=20220308115103.3664883-5-s.hauer@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /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