]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
cpufreq: airoha: Convert to of_machine_get_match()
authorGeert Uytterhoeven <geert+renesas@glider.be>
Mon, 2 Mar 2026 16:29:07 +0000 (17:29 +0100)
committerRob Herring (Arm) <robh@kernel.org>
Fri, 13 Mar 2026 22:00:04 +0000 (17:00 -0500)
Use the of_machine_get_match() helper instead of open-coding the same
operation.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Link: https://patch.msgid.link/cc76137755d93af982bf255095adafc7d523692c.1772468323.git.geert+renesas@glider.be
Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
drivers/cpufreq/airoha-cpufreq.c

index b6b1cdc4d11d69626c63c7ac74e163ca690999d4..3e7770860d13c8f47f0fe4c1242c9e8fc4aeb3d9 100644 (file)
@@ -115,15 +115,10 @@ MODULE_DEVICE_TABLE(of, airoha_cpufreq_match_list);
 
 static int __init airoha_cpufreq_init(void)
 {
-       struct device_node *np = of_find_node_by_path("/");
        const struct of_device_id *match;
        int ret;
 
-       if (!np)
-               return -ENODEV;
-
-       match = of_match_node(airoha_cpufreq_match_list, np);
-       of_node_put(np);
+       match = of_machine_get_match(airoha_cpufreq_match_list);
        if (!match)
                return -ENODEV;