Skip to content

Commit 4b94d21

Browse files
krzkrobherring
authored andcommitted
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>
1 parent 1ead134 commit 4b94d21

1 file changed

Lines changed: 1 addition & 10 deletions

File tree

drivers/cpuidle/cpuidle-big_little.c

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -166,20 +166,11 @@ static const struct of_device_id compatible_machine_match[] = {
166166
static int __init bl_idle_init(void)
167167
{
168168
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;
174169

175170
/*
176171
* Initialize the driver just for a compliant set of machines
177172
*/
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))
183174
return -ENODEV;
184175

185176
if (!mcpm_is_available())

0 commit comments

Comments
 (0)