Re: [PATCH] soc: imx8m: Fix match data lookup for soc device

From: Richard Leitner

Date: Tue May 26 2026 - 05:14:39 EST


On Mon, Apr 27, 2026 at 09:01:48AM +0800, Peng Fan (OSS) wrote:
> From: Peng Fan <peng.fan@xxxxxxx>
>
> The i.MX8M soc device is registered via platform_device_register_simple(),
> so it is not associated with a Device Tree node and the imx8m_soc_driver
> has no of_match_table.
>
> As a result, device_get_match_data() always returns NULL when probing
> the soc device.
>
> Retrieve the match data directly from the machine compatible using
> of_machine_get_match_data(imx8_soc_match), which provides the correct SoC
> data.
>
> Fixes: 2524b293a59e5 ("soc: imx8m: don't access of_root directly")
> Signed-off-by: Peng Fan <peng.fan@xxxxxxx>

Thanks for that fix!

Tested-by: Richard Leitner <richard.leitner@xxxxxxxxx> # i.MX8MP

regards;rl

> ---
> drivers/soc/imx/soc-imx8m.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/soc/imx/soc-imx8m.c b/drivers/soc/imx/soc-imx8m.c
> index 77763a107edbd11302017e3f61ecb4369fda1ab0..fc080e56f50d423b88a673181a6bc986eb4c1691 100644
> --- a/drivers/soc/imx/soc-imx8m.c
> +++ b/drivers/soc/imx/soc-imx8m.c
> @@ -247,7 +247,7 @@ static int imx8m_soc_probe(struct platform_device *pdev)
> if (ret)
> return ret;
>
> - data = device_get_match_data(dev);
> + data = of_machine_get_match_data(imx8_soc_match);
> if (data) {
> soc_dev_attr->soc_id = data->name;
> ret = imx8m_soc_prepare(pdev, data->ocotp_compatible);
>
> ---
> base-commit: 70c8a7ec6715b5fb14e501731b5b9210a16684f7
> change-id: 20260424-soc-imx8m-fix-90d7ce2397f5
>
> Best regards,
> --
> Peng Fan <peng.fan@xxxxxxx>
>
>