Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

soc: imx9: don't access of_root directly

Don't access of_root directly as it reduces the build test coverage for
this driver with COMPILE_TEST=y and OF=n. Use existing helper functions
to retrieve the relevant information.

Suggested-by: Rob Herring <robh@kernel.org>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
Link: https://patch.msgid.link/20260223-soc-of-root-v2-7-b45da45903c8@oss.qualcomm.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Bartosz Golaszewski and committed by
Greg Kroah-Hartman
01898f5e 2524b293

+2 -2
+2 -2
drivers/soc/imx/soc-imx9.c
··· 30 30 if (!attr) 31 31 return -ENOMEM; 32 32 33 - err = of_property_read_string(of_root, "model", &attr->machine); 33 + err = soc_attr_read_machine(attr); 34 34 if (err) 35 35 return dev_err_probe(dev, err, "%s: missing model property\n", __func__); 36 36 ··· 89 89 struct platform_device *pdev; 90 90 91 91 /* No match means it is not an i.MX 9 series SoC, do nothing. */ 92 - if (!of_match_node(imx9_soc_match, of_root)) 92 + if (!of_machine_device_match(imx9_soc_match)) 93 93 return 0; 94 94 95 95 ret = platform_driver_register(&imx9_soc_driver);