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

Configure Feed

Select the types of activity you want to include in your feed.

ASoC: da7219: scope AAD suspend and resume helpers to CONFIG_PM

In current linux.git, da7219_aad_suspend() and
da7219_aad_resume() are defined and declared unconditionally. However,
their only in-tree callers are the component PM callbacks in da7219.c,
which are already guarded by #ifdef CONFIG_PM.

This inconsistency leads to unnecessary code inclusion and potential
compiler warnings when CONFIG_PM is disabled. Match the helper
declarations and definitions to the callers' scope and provide no-op
!CONFIG_PM stubs in the header.

Signed-off-by: Pengpeng Hou <pengpeng.hou@isrc.iscas.ac.cn>
Link: https://patch.msgid.link/20260310082348.743716-1-pengpeng.hou@isrc.iscas.ac.cn
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Pengpeng Hou and committed by
Mark Brown
4ba5c637 9be71d46

+7 -1
+2 -1
sound/soc/codecs/da7219-aad.c
··· 924 924 * Suspend/Resume 925 925 */ 926 926 927 + #ifdef CONFIG_PM 927 928 void da7219_aad_suspend(struct snd_soc_component *component) 928 929 { 929 930 struct da7219_priv *da7219 = snd_soc_component_get_drvdata(component); ··· 982 981 983 982 enable_irq(da7219_aad->irq); 984 983 } 985 - 984 + #endif 986 985 987 986 /* 988 987 * Init/Exit
+5
sound/soc/codecs/da7219-aad.h
··· 209 209 void da7219_aad_jack_det(struct snd_soc_component *component, struct snd_soc_jack *jack); 210 210 211 211 /* Suspend/Resume */ 212 + #ifdef CONFIG_PM 212 213 void da7219_aad_suspend(struct snd_soc_component *component); 213 214 void da7219_aad_resume(struct snd_soc_component *component); 215 + #else 216 + static inline void da7219_aad_suspend(struct snd_soc_component *component) { } 217 + static inline void da7219_aad_resume(struct snd_soc_component *component) { } 218 + #endif 214 219 215 220 /* Init/Exit */ 216 221 int da7219_aad_init(struct snd_soc_component *component);