From a73ee73c7870b0fbfb544c21e39de2bd1aa5ff54 Mon Sep 17 00:00:00 2001 From: wangjianyu3 Date: Wed, 18 Sep 2024 04:20:13 +0800 Subject: [PATCH] Thermal/dummy: Fix depends error MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. cpufreq.h not found if cpufreq is not supported on some branches. ./thermal/thermal_dummy.c:25:10: fatal error: nuttx/cpufreq.h: No such file or directory 25 | #include | ^~~~~~~~~~~~~~~~~ compilation terminated. 2. debug.h is included by including , should not. CC: thermal/thermal_dummy.c thermal/thermal_dummy.c: In function ‘thermal_dummy_init’: thermal/thermal_dummy.c:338:7: warning: implicit declaration of function ‘therr’ [-Wimplicit-function-declaration] 338 | therr("Register cooling device fan0 failed!\n"); | https://github.com/apache/nuttx/pull/12824 Signed-off-by: wangjianyu3 --- drivers/thermal/thermal_dummy.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/thermal/thermal_dummy.c b/drivers/thermal/thermal_dummy.c index 1cda6ccf0a..ee35b8c857 100644 --- a/drivers/thermal/thermal_dummy.c +++ b/drivers/thermal/thermal_dummy.c @@ -22,9 +22,13 @@ * Included Files ****************************************************************************/ +#include +#ifdef CONFIG_THERMAL_DUMMY_CPUFREQ #include +#endif #include +#include #include /**************************************************************************** @@ -50,6 +54,7 @@ struct dummy_cooling_device_s unsigned int max_state; }; +#ifdef CONFIG_THERMAL_DUMMY_CPUFREQ struct dummy_cpufreq_driver_s { struct cpufreq_driver driver; @@ -57,6 +62,7 @@ struct dummy_cpufreq_driver_s size_t table_len; struct cpufreq_frequency_table current; }; +#endif /**************************************************************************** * Private Function Prototypes