From 4f2df89798f697fa5d75383e2e5e975b5acbfb68 Mon Sep 17 00:00:00 2001 From: guanyi Date: Tue, 11 Aug 2026 16:42:03 +0800 Subject: [PATCH] drivers/devfreq: add missing governor_data field and ondemand declaration The ondemand governor (devfreq_ondemand.c) references dev->governor_data to store its private state, and defines devfreq_ondemand(), but neither the field in struct devfreq_s nor the function declaration were present in include/nuttx/devfreq.h. As a result, building with CONFIG_DEVFREQ_GOV_ONDEMAND=y failed to compile. These two definitions were originally introduced by a downstream commit that was not part of the devfreq upstreaming series, so the gap only surfaced when the ondemand governor is enabled (which additionally requires !CONFIG_SCHED_CPULOAD_NONE and is off by default). Add the governor_data field to struct devfreq_s and declare devfreq_ondemand() alongside the other governors. Signed-off-by: guanyi --- include/nuttx/devfreq.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/nuttx/devfreq.h b/include/nuttx/devfreq.h index 13c28d1787b69..dc1ca051ce09b 100644 --- a/include/nuttx/devfreq.h +++ b/include/nuttx/devfreq.h @@ -63,6 +63,7 @@ struct devfreq_s FAR const struct devfreq_driver_s *driver; FAR const uint32_t *freq_table; + FAR void *governor_data; struct qos_constraints_s constraints; @@ -353,6 +354,7 @@ void devfreq_procfs_initialize(void); FAR struct devfreq_governor_s *devfreq_performance(void); FAR struct devfreq_governor_s *devfreq_powersave(void); +FAR struct devfreq_governor_s *devfreq_ondemand(void); #undef EXTERN #if defined(__cplusplus)