]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
ASoC: da7219: scope AAD suspend and resume helpers to CONFIG_PM
authorPengpeng Hou <pengpeng.hou@isrc.iscas.ac.cn>
Tue, 10 Mar 2026 08:23:48 +0000 (08:23 +0000)
committerMark Brown <broonie@kernel.org>
Tue, 10 Mar 2026 19:32:42 +0000 (19:32 +0000)
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>
sound/soc/codecs/da7219-aad.c
sound/soc/codecs/da7219-aad.h

index d9d932a78b710c80205ca4279cec1beb22c9dde1..0b3b108aaeee52e23b95533dc0880c1e258fd9bc 100644 (file)
@@ -924,6 +924,7 @@ static void da7219_aad_handle_gnd_switch_time(struct snd_soc_component *componen
  * Suspend/Resume
  */
 
+#ifdef CONFIG_PM
 void da7219_aad_suspend(struct snd_soc_component *component)
 {
        struct da7219_priv *da7219 = snd_soc_component_get_drvdata(component);
@@ -981,7 +982,7 @@ void da7219_aad_resume(struct snd_soc_component *component)
 
        enable_irq(da7219_aad->irq);
 }
-
+#endif
 
 /*
  * Init/Exit
index fbfbf3e67918de5a2bec48de068063569a3cdb7d..ea5b81819247726d3ce1be199f92d3800b014087 100644 (file)
@@ -209,8 +209,13 @@ struct da7219_aad_priv {
 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);