[PATCH] ASoC: da7219: scope AAD suspend and resume helpers to CONFIG_PM
From: Pengpeng Hou
Date: Mon Mar 09 2026 - 04:28:39 EST
From: pengpeng.hou@xxxxxxxxxxxxxxxx
In current linux.git (1954c4f01220), 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@xxxxxxxxxxx
---
diff --git a/sound/soc/codecs/da7219-aad.c b/sound/soc/codecs/da7219-aad.c
--- a/sound/soc/codecs/da7219-aad.c
+++ b/sound/soc/codecs/da7219-aad.c
@@
/*
* Suspend/Resume
*/
+#ifdef CONFIG_PM
void da7219_aad_suspend(struct snd_soc_component *component)
{
struct da7219_priv *da7219 = snd_soc_component_get_drvdata(component);
@@
da7219_aad->micbias_resume_enable = false;
}
}
}
+#endif
/*
* Init/Exit
*/
diff --git a/sound/soc/codecs/da7219-aad.h b/sound/soc/codecs/da7219-aad.h
--- a/sound/soc/codecs/da7219-aad.h
+++ b/sound/soc/codecs/da7219-aad.h
@@
void da7219_aad_jack_det(struct snd_soc_component *component, struct snd_soc_jack *jack);
/* Suspend/Resume */
+#ifdef CONFIG_PM
void da7219_aad_suspend(struct snd_soc_component *component);
void da7219_aad_resume(struct snd_soc_component *component);
+#else
+static inline void da7219_aad_suspend(struct snd_soc_component *component) { }
+static inline void da7219_aad_resume(struct snd_soc_component *component) { }
+#endif
/* Init/Exit */
int da7219_aad_init(struct snd_soc_component *component);