public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] cpufreq: create cooling device based on ACPI
@ 2023-04-28  7:03 wangyouwan
  2023-04-28  9:56 ` Dhruva Gole
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: wangyouwan @ 2023-04-28  7:03 UTC (permalink / raw)
  To: rafael, viresh.kumar; +Cc: linux-pm, linux-kernel, youwan Wang

From: youwan Wang <wangyouwan@126.com>

When using the "scpi_cpufreq" driver, an error
occurs:cpufreq_cooling: OF node not available for cpu*.
The current computer motherboard is using ACPI firmware.
Go to see that the error is caused by calling the
"of_cpufreq_cooling_register" interface.
comment:create cpufreq cooling device based on DT.

Signed-off-by: youwan Wang <wangyouwan@126.com>
---
 drivers/cpufreq/cpufreq.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index 6b52ebe5a890..3418c68959d5 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -1528,8 +1528,13 @@ static int cpufreq_online(unsigned int cpu)
 	if (cpufreq_driver->ready)
 		cpufreq_driver->ready(policy);
 
-	if (cpufreq_thermal_control_enabled(cpufreq_driver))
+	if (cpufreq_thermal_control_enabled(cpufreq_driver)) {
+#ifdef CONFIG_ACPI
+		policy->cdev = cpufreq_cooling_register(policy);
+#else
 		policy->cdev = of_cpufreq_cooling_register(policy);
+#endif
+	}
 
 	pr_debug("initialization complete\n");
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-05-10  8:49 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-28  7:03 [PATCH] cpufreq: create cooling device based on ACPI wangyouwan
2023-04-28  9:56 ` Dhruva Gole
2023-05-10  8:48   ` wangyouwan
2023-04-28 11:37 ` Rafael J. Wysocki
2023-05-10  7:51   ` wangyouwan
2023-05-08  7:12 ` 回复: " Xinglong Yang
     [not found]   ` <205f534.5815.18804b3dd08.Coremail.wangyouwan@126.com>
     [not found]     ` <PUZPR06MB5498536FCB73BD6D5BD928ECF0779@PUZPR06MB5498.apcprd06.prod.outlook.com>
2023-05-10  8:45       ` Re:回复: " wangyouwan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox