Skip to content

Commit 4ba5c63

Browse files
Pengpeng Houbroonie
authored andcommitted
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>
1 parent 9be71d4 commit 4ba5c63

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

sound/soc/codecs/da7219-aad.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -924,6 +924,7 @@ static void da7219_aad_handle_gnd_switch_time(struct snd_soc_component *componen
924924
* Suspend/Resume
925925
*/
926926

927+
#ifdef CONFIG_PM
927928
void da7219_aad_suspend(struct snd_soc_component *component)
928929
{
929930
struct da7219_priv *da7219 = snd_soc_component_get_drvdata(component);
@@ -981,7 +982,7 @@ void da7219_aad_resume(struct snd_soc_component *component)
981982

982983
enable_irq(da7219_aad->irq);
983984
}
984-
985+
#endif
985986

986987
/*
987988
* Init/Exit

sound/soc/codecs/da7219-aad.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,8 +209,13 @@ struct da7219_aad_priv {
209209
void da7219_aad_jack_det(struct snd_soc_component *component, struct snd_soc_jack *jack);
210210

211211
/* Suspend/Resume */
212+
#ifdef CONFIG_PM
212213
void da7219_aad_suspend(struct snd_soc_component *component);
213214
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
214219

215220
/* Init/Exit */
216221
int da7219_aad_init(struct snd_soc_component *component);

0 commit comments

Comments
 (0)