]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
of: Convert to of_machine_get_match()
authorGeert Uytterhoeven <geert+renesas@glider.be>
Mon, 2 Mar 2026 16:29:06 +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/83ed49314b94dab7781e1d74236af72dd5c349c6.1772468323.git.geert+renesas@glider.be
Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
drivers/of/base.c

index 2a01d2a66eed646d2392e2e88e6464c1d58e5b68..af048ab88e694361dac0c2e0c6289eecc46f226d 100644 (file)
@@ -464,15 +464,8 @@ EXPORT_SYMBOL(of_machine_get_match);
 const void *of_machine_get_match_data(const struct of_device_id *matches)
 {
        const struct of_device_id *match;
-       struct device_node *root;
-
-       root = of_find_node_by_path("/");
-       if (!root)
-               return NULL;
-
-       match = of_match_node(matches, root);
-       of_node_put(root);
 
+       match = of_machine_get_match(matches);
        if (!match)
                return NULL;