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 <[email protected]>
Signed-off-by: Bartosz Golaszewski <[email protected]>
---
 drivers/soc/imx/soc-imx9.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/soc/imx/soc-imx9.c b/drivers/soc/imx/soc-imx9.c
index 
b46d22cf0212c3f40f61ec5be85ca11e5d3207ac..0cea4307ac3923f416a63bca793a78835d868448
 100644
--- a/drivers/soc/imx/soc-imx9.c
+++ b/drivers/soc/imx/soc-imx9.c
@@ -29,7 +29,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_device_get_machine(attr);
        if (err) {
                pr_err("%s: missing model property: %d\n", __func__, err);
                goto attr;
@@ -103,7 +103,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);

-- 
2.47.3


Reply via email to