]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
cpuidle: big_little: Simplify with of_machine_device_match()
authorKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Wed, 12 Nov 2025 10:28:50 +0000 (11:28 +0100)
committerRob Herring (Arm) <robh@kernel.org>
Thu, 27 Nov 2025 01:42:40 +0000 (19:42 -0600)
Replace open-coded getting root OF node and matching against it with
new of_machine_device_match() helper.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://patch.msgid.link/20251112-b4-of-match-matchine-data-v2-5-d46b72003fd6@linaro.org
Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
drivers/cpuidle/cpuidle-big_little.c

index 4abba42fcc311273795d00ff6977a132916e6a9f..08f6bf2f64091b8ec1f4edef443849b6a5cd81fb 100644 (file)
@@ -166,20 +166,11 @@ static const struct of_device_id compatible_machine_match[] = {
 static int __init bl_idle_init(void)
 {
        int ret;
-       struct device_node *root = of_find_node_by_path("/");
-       const struct of_device_id *match_id;
-
-       if (!root)
-               return -ENODEV;
 
        /*
         * Initialize the driver just for a compliant set of machines
         */
-       match_id = of_match_node(compatible_machine_match, root);
-
-       of_node_put(root);
-
-       if (!match_id)
+       if (!of_machine_device_match(compatible_machine_match))
                return -ENODEV;
 
        if (!mcpm_is_available())