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

Sascha Hauer sha at pengutronix.de
Mon Jan 16 04:13:07 PST 2023


On Fri, Jan 13, 2023 at 12:34:00PM +0100, Oleksij Rempel wrote:
> Port board code to the driver model
> 
> Signed-off-by: Oleksij Rempel <o.rempel at pengutronix.de>
> ---
>  arch/arm/boards/udoo-neo/board.c | 18 +++++++++++++-----
>  1 file changed, 13 insertions(+), 5 deletions(-)

Applied, thanks

Sascha

> 
> 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
> 
> 
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



More information about the barebox mailing list