mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH v2 3/4] boards: qemu-virt: ensure board driver probe at postcore_initcall level
Date: Fri, 10 Feb 2023 17:53:52 +0100	[thread overview]
Message-ID: <20230210165353.3601175-3-a.fatoum@pengutronix.de> (raw)
In-Reply-To: <20230210165353.3601175-1-a.fatoum@pengutronix.de>

Qemu board driver fixups should be applied very early to be able to
influence core components, even if they are controlled directly by
initcalls. For this reason, enforce probe of the driver at postcore_initcall
level.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
v1 -> v2:
  - new patch -- otherwise, probe happens after initcall adding rsa keys
---
 common/boards/qemu-virt/board.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/common/boards/qemu-virt/board.c b/common/boards/qemu-virt/board.c
index d0f4412cdea5..ec92ae94aec9 100644
--- a/common/boards/qemu-virt/board.c
+++ b/common/boards/qemu-virt/board.c
@@ -65,4 +65,14 @@ static struct driver virt_board_driver = {
 	.of_compatible = virt_of_match,
 };
 
-postcore_platform_driver(virt_board_driver);
+static int virt_board_driver_init(void)
+{
+	int ret;
+
+	ret = platform_driver_register(&virt_board_driver);
+	if (ret)
+		return ret;
+
+	return of_devices_ensure_probed_by_dev_id(virt_of_match);
+}
+postcore_initcall(virt_board_driver_init);
-- 
2.30.2




  parent reply	other threads:[~2023-02-10 16:55 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-10 16:53 [PATCH v2 1/4] of: base: factor out of_merge_nodes from of_copy_node Ahmad Fatoum
2023-02-10 16:53 ` [PATCH v2 2/4] of: support of_ensure_probed for top-level machine device Ahmad Fatoum
2023-03-10 14:46   ` Michael Riesch
2023-03-10 16:19     ` Ahmad Fatoum
2023-03-13  7:05       ` Michael Riesch
2023-03-13 14:43         ` Ahmad Fatoum
2023-02-10 16:53 ` Ahmad Fatoum [this message]
2023-02-10 16:53 ` [PATCH v2 4/4] boards: qemu-virt: support passing in FIT public key Ahmad Fatoum
2023-02-10 17:32   ` Jan Lübbe
2023-02-13  8:45   ` Sascha Hauer
2023-02-17 13:03     ` Ahmad Fatoum
2023-03-09 12:47       ` Ahmad Fatoum
2023-03-10  9:51 ` [PATCH v2 1/4] of: base: factor out of_merge_nodes from of_copy_node 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=20230210165353.3601175-3-a.fatoum@pengutronix.de \
    --to=a.fatoum@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