]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
airoha: fix cpufreq probe failure
authorDaniel Schwierzeck <daniel.schwierzeck@gmail.com>
Wed, 8 Jul 2026 13:43:44 +0000 (15:43 +0200)
committerRobert Marko <robimarko@gmail.com>
Sat, 8 Aug 2026 09:39:30 +0000 (11:39 +0200)
dev_pm_domain_attach_list() returns the number of attached PM domains
on success (a positive count), or a negative error code on failure.
The airoha-cpufreq driver checks 'if (ret)' which treats a successful
attachment as an error.

Fix by checking 'if (ret < 0)' like all other users of this API.

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
target/linux/airoha/patches-6.18/607-cpufreq-airoha-fix-probe-failure-with-correct-error-check.patch [new file with mode: 0644]

diff --git a/target/linux/airoha/patches-6.18/607-cpufreq-airoha-fix-probe-failure-with-correct-error-check.patch b/target/linux/airoha/patches-6.18/607-cpufreq-airoha-fix-probe-failure-with-correct-error-check.patch
new file mode 100644 (file)
index 0000000..8c9d29d
--- /dev/null
@@ -0,0 +1,29 @@
+From 0f9e175213f76b8b9ecf7e0c854c0c91c7264629 Mon Sep 17 00:00:00 2001
+From: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
+Date: Wed, 8 Jul 2026 00:00:00 +0200
+Subject: [PATCH] cpufreq: airoha: fix probe failure with correct error check
+
+dev_pm_domain_attach_list() returns the number of attached PM domains
+on success (a positive count), or a negative error code on failure.
+The driver checks "if (ret)" which treats a successful attachment of
+one or more PM domains as an error, causing the probe to fail with
+return code 1.
+
+Fix by checking "if (ret < 0)" like all other users of this API.
+
+Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
+---
+ drivers/cpufreq/airoha-cpufreq.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/cpufreq/airoha-cpufreq.c
++++ b/drivers/cpufreq/airoha-cpufreq.c
+@@ -65,7 +65,7 @@ static int airoha_cpufreq_probe(struct p
+       /* Attach PM for OPP */
+       ret = dev_pm_domain_attach_list(cpu_dev, &attach_data,
+                                       &priv->pd_list);
+-      if (ret)
++      if (ret < 0)
+               goto clear_opp_config;
+       cpufreq_dt = platform_device_register_simple("cpufreq-dt", -1, NULL, 0);