[PATCH 5/9] ARM: boards: protonic-rk356x: Move mecsbc code to model init function

Sascha Hauer s.hauer at pengutronix.de
Tue Mar 10 03:20:04 PDT 2026


Hi Robin,

On Wed, Mar 04, 2026 at 12:00:09PM +0100, Robin van der Gracht wrote:
> This adds a means for registering a model specific late initcall function.

Please explain why this is necessary in the commit message.

> +static int prt_rk356x_mecsbc_init(void)
> +{
> +	if (prt_priv.hw_id == 0 && prt_priv.hw_rev == 0)
> +		of_register_fixup(mecsbc_sd_of_fixup, prt_priv.dev);
> +
> +	return 0;
> +}
> +
> +static int prt_rk356x_devices_init(void)
> +{
> +	int ret;
> +
> +	if (prt_priv.model->init) {
> +		ret = prt_priv.model->init();
> +		if (ret) {
> +			pr_warn("Model init failed with %d\n", ret);
> +			return ret;
> +		}
> +	}
> +
> +	return 0;
> +}
> +late_initcall(prt_rk356x_devices_init);

This executes unconditionally on all boards. You have a patch later in
this series fixing that, please squash it into this patch.

Sascha

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