mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-16 03:11:11 -04:00
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>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
2524b293a5
commit
01898f5ed6
@@ -30,7 +30,7 @@ static int imx9_soc_probe(struct platform_device *pdev)
|
||||
if (!attr)
|
||||
return -ENOMEM;
|
||||
|
||||
err = of_property_read_string(of_root, "model", &attr->machine);
|
||||
err = soc_attr_read_machine(attr);
|
||||
if (err)
|
||||
return dev_err_probe(dev, err, "%s: missing model property\n", __func__);
|
||||
|
||||
@@ -89,7 +89,7 @@ static int __init imx9_soc_init(void)
|
||||
struct platform_device *pdev;
|
||||
|
||||
/* No match means it is not an i.MX 9 series SoC, do nothing. */
|
||||
if (!of_match_node(imx9_soc_match, of_root))
|
||||
if (!of_machine_device_match(imx9_soc_match))
|
||||
return 0;
|
||||
|
||||
ret = platform_driver_register(&imx9_soc_driver);
|
||||
|
||||
Reference in New Issue
Block a user