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 <o.rempel@pengutronix.de>
Subject: [PATCH v1 1/8] ARM: imx6sx: udoo-neo: port to driver model
Date: Fri, 13 Jan 2023 12:34:00 +0100	[thread overview]
Message-ID: <20230113113407.2684725-1-o.rempel@pengutronix.de> (raw)

Port board code to the driver model

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
---
 arch/arm/boards/udoo-neo/board.c | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)

diff --git a/arch/arm/boards/udoo-neo/board.c b/arch/arm/boards/udoo-neo/board.c
index 5964e92159..3bed20ae50 100644
--- a/arch/arm/boards/udoo-neo/board.c
+++ b/arch/arm/boards/udoo-neo/board.c
@@ -5,13 +5,21 @@
 #include <init.h>
 #include <linux/clk.h>
 
-static int imx6sx_udoneo_coredevices_init(void)
+static int imx6sx_udoneo_probe(struct device *dev)
 {
-	if (!of_machine_is_compatible("fsl,imx6sx-udoo-neo"))
-		return 0;
-
 	barebox_set_hostname("mx6sx-udooneo");
 
 	return 0;
 }
-coredevice_initcall(imx6sx_udoneo_coredevices_init);
+
+static const struct of_device_id imx6sx_udoneo_of_match[] = {
+	{ .compatible = "fsl,imx6sx-udoo-neo" },
+	{ /* sentinel */ },
+};
+
+static struct driver imx6sx_udoneo_driver = {
+	.name = "board-udoo-neo",
+	.probe = imx6sx_udoneo_probe,
+	.of_compatible = imx6sx_udoneo_of_match,
+};
+postcore_platform_driver(imx6sx_udoneo_driver);
-- 
2.30.2




             reply	other threads:[~2023-01-13 11:39 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-13 11:34 Oleksij Rempel [this message]
2023-01-13 11:34 ` [PATCH v1 2/8] ARM: imx6sx: udoo-neo: enable deep probe support Oleksij Rempel
2023-01-13 11:34 ` [PATCH v1 3/8] ARM: imx6sx: udoo-neo: fix board compatible Oleksij Rempel
2023-01-13 11:34 ` [PATCH v1 4/8] ARM: imx6sx: udoo-neo: configure GPIO pins for board auto detection Oleksij Rempel
2023-01-13 11:34 ` [PATCH v1 5/8] ARM: imx6sx: udoo-neo: add version detection support Oleksij Rempel
2023-01-13 11:34 ` [PATCH v1 6/8] ARM: imx6sx: udoo-neo: enable memory size auto detection Oleksij Rempel
2023-01-13 11:34 ` [PATCH v1 7/8] ARM: imx6sx: udoo-neo: fix gpt timer configuration Oleksij Rempel
2023-01-13 11:34 ` [PATCH v1 8/8] ARM: imx6sx: udoo-neo: add barebox update handler support Oleksij Rempel
2023-01-16 12:13 ` [PATCH v1 1/8] ARM: imx6sx: udoo-neo: port to driver model 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=20230113113407.2684725-1-o.rempel@pengutronix.de \
    --to=o.rempel@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