From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jyYXc-0000mb-HV for barebox@lists.infradead.org; Thu, 23 Jul 2020 10:33:35 +0000 From: Oleksij Rempel Date: Thu, 23 Jul 2020 12:33:18 +0200 Message-Id: <20200723103326.23226-4-o.rempel@pengutronix.de> In-Reply-To: <20200723103326.23226-1-o.rempel@pengutronix.de> References: <20200723103326.23226-1-o.rempel@pengutronix.de> MIME-Version: 1.0 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "barebox" Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: [PATCH v1 03/11] ARM: embest-riotboard: port board file to the driver model To: barebox@lists.infradead.org, david@protonic.nl Cc: Oleksij Rempel This patch can be used as example for the new board-driver functionality. Signed-off-by: Oleksij Rempel --- arch/arm/boards/embest-riotboard/board.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/arch/arm/boards/embest-riotboard/board.c b/arch/arm/boards/embest-riotboard/board.c index 2e0cc9f0ab..746ecf0562 100644 --- a/arch/arm/boards/embest-riotboard/board.c +++ b/arch/arm/boards/embest-riotboard/board.c @@ -51,11 +51,8 @@ static int ar8035_phy_fixup(struct phy_device *dev) return 0; } -static int riotboard_device_init(void) +static int riotboard_probe(struct device_d *dev) { - if (!of_machine_is_compatible("riot,imx6s-riotboard")) - return 0; - phy_register_fixup_for_uid(0x004dd072, 0xffffffef, ar8035_phy_fixup); imx6_bbu_internal_mmc_register_handler("emmc", "/dev/mmc3.barebox", @@ -65,4 +62,15 @@ static int riotboard_device_init(void) return 0; } -device_initcall(riotboard_device_init); + +static const struct of_device_id riotboard_of_match[] = { + { .compatible = "riot,imx6s-riotboard" }, + {}, +}; + +static struct driver_d riotboard_driver = { + .name = "board-embest-riot", + .probe = riotboard_probe, + .of_compatible = DRV_OF_COMPAT(riotboard_of_match), +}; +device_platform_driver(riotboard_driver); -- 2.27.0 _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox