[PATCH 3/7] cpufreq: airoha: Convert to of_machine_get_match()

From: Geert Uytterhoeven

Date: Mon Mar 02 2026 - 11:31:38 EST


Use the of_machine_get_match() helper instead of open-coding the same
operation.

Signed-off-by: Geert Uytterhoeven <geert+renesas@xxxxxxxxx>
---
Compile-tested only.
---
drivers/cpufreq/airoha-cpufreq.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/cpufreq/airoha-cpufreq.c b/drivers/cpufreq/airoha-cpufreq.c
index b6b1cdc4d11d6962..3e7770860d13c8f4 100644
--- a/drivers/cpufreq/airoha-cpufreq.c
+++ b/drivers/cpufreq/airoha-cpufreq.c
@@ -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;

--
2.43.0