Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

PM / devfreq: Fix build issues with devfreq disabled

The existing no-op shims for when PM_DEVFREQ (or an individual governor)
only do half the job. The governor specific config/tuning structs need
to be available to avoid compile errors in drivers using devfreq.

Fixes: 6563f60f14cb ("drm/msm/gpu: Add devfreq tuning debugfs")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Acked-by: MyungJoo Ham <myungjoo.ham@samsung.com>
Acked-by: Chanwoo Choi <cw00.choi@samsung.com>
Patchwork: https://patchwork.freedesktop.org/patch/519801/
Link: https://lore.kernel.org/r/20230123153745.3185032-1-robdclark@gmail.com

+2 -5
+2 -5
include/linux/devfreq.h
··· 273 273 struct devfreq *devfreq_get_devfreq_by_node(struct device_node *node); 274 274 struct devfreq *devfreq_get_devfreq_by_phandle(struct device *dev, 275 275 const char *phandle_name, int index); 276 + #endif /* CONFIG_PM_DEVFREQ */ 276 277 277 - #if IS_ENABLED(CONFIG_DEVFREQ_GOV_SIMPLE_ONDEMAND) 278 278 /** 279 279 * struct devfreq_simple_ondemand_data - ``void *data`` fed to struct devfreq 280 280 * and devfreq_add_device ··· 292 292 unsigned int upthreshold; 293 293 unsigned int downdifferential; 294 294 }; 295 - #endif 296 295 297 - #if IS_ENABLED(CONFIG_DEVFREQ_GOV_PASSIVE) 298 296 enum devfreq_parent_dev_type { 299 297 DEVFREQ_PARENT_DEV, 300 298 CPUFREQ_PARENT_DEV, ··· 335 337 struct notifier_block nb; 336 338 struct list_head cpu_data_list; 337 339 }; 338 - #endif 339 340 340 - #else /* !CONFIG_PM_DEVFREQ */ 341 + #if !defined(CONFIG_PM_DEVFREQ) 341 342 static inline struct devfreq *devfreq_add_device(struct device *dev, 342 343 struct devfreq_dev_profile *profile, 343 344 const char *governor_name,