[PATCH v1 1/8] ARM: imx6sx: udoo-neo: port to driver model

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Port board code to the driver model

Signed-off-by: Oleksij Rempel <o.rempel@xxxxxxxxxxxxxx>
---
 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





[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux