Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

cpuidle: big_little: Simplify with of_machine_device_match()

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>

authored by

Krzysztof Kozlowski and committed by
Rob Herring (Arm)
4b94d21f 1ead1349

+1 -10
+1 -10
drivers/cpuidle/cpuidle-big_little.c
··· 166 166 static int __init bl_idle_init(void) 167 167 { 168 168 int ret; 169 - struct device_node *root = of_find_node_by_path("/"); 170 - const struct of_device_id *match_id; 171 - 172 - if (!root) 173 - return -ENODEV; 174 169 175 170 /* 176 171 * Initialize the driver just for a compliant set of machines 177 172 */ 178 - match_id = of_match_node(compatible_machine_match, root); 179 - 180 - of_node_put(root); 181 - 182 - if (!match_id) 173 + if (!of_machine_device_match(compatible_machine_match)) 183 174 return -ENODEV; 184 175 185 176 if (!mcpm_is_available())