From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: mfe@pengutronix.de, Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH 3/5] environment: register barebox env OF driver regardless of /chosen
Date: Tue, 26 Nov 2024 16:33:10 +0100 [thread overview]
Message-ID: <20241126153312.3758355-4-a.fatoum@pengutronix.de> (raw)
In-Reply-To: <20241126153312.3758355-1-a.fatoum@pengutronix.de>
Even if we don't have a /chosen node, a barebox,environment node may be
added later or it may not be under /chosen at all with the incoming new
binding.
Therefore register the driver unconditionally if we are on an OF system.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
drivers/of/barebox.c | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)
diff --git a/drivers/of/barebox.c b/drivers/of/barebox.c
index ed5d171e43a8..65392697913b 100644
--- a/drivers/of/barebox.c
+++ b/drivers/of/barebox.c
@@ -108,13 +108,9 @@ static int barebox_of_driver_init(void)
return 0;
node = of_find_node_by_path("/chosen");
- if (!node)
- return 0;
+ if (node)
+ of_platform_populate(node, of_default_bus_match_table, NULL);
- of_platform_populate(node, of_default_bus_match_table, NULL);
-
- platform_driver_register(&environment_driver);
-
- return 0;
+ return platform_driver_register(&environment_driver);
}
late_initcall(barebox_of_driver_init);
--
2.39.5
next prev parent reply other threads:[~2024-11-26 15:34 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-26 15:33 [PATCH 0/5] environment: upstream-NVMEM-compliant OF binding Ahmad Fatoum
2024-11-26 15:33 ` [PATCH 1/5] of: partition: don't parse nvmem-cells in legacy " Ahmad Fatoum
2024-11-26 15:33 ` [PATCH 2/5] nvmem: probe nvmem-cells container via driver model Ahmad Fatoum
2024-11-26 15:33 ` Ahmad Fatoum [this message]
2024-11-26 15:33 ` [PATCH 4/5] environment: add support for a single node barebox,environment binding Ahmad Fatoum
2024-11-26 15:33 ` [PATCH 5/5] sandbox: switch to new barebox environment binding Ahmad Fatoum
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=20241126153312.3758355-4-a.fatoum@pengutronix.de \
--to=a.fatoum@pengutronix.de \
--cc=barebox@lists.infradead.org \
--cc=mfe@pengutronix.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